Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
6fe18101
Commit
6fe18101
authored
3 years ago
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
Add the restore error operation to the report object
parent
afd13499
No related branches found
No related tags found
3 merge requests
!231
Revert "Update store to print changes to the partners list"
,
!187
Xx 3829/triggers
,
!182
Add the restore error operation to the report object
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/restoreContacts.go
+13
-3
13 additions, 3 deletions
bindings/restoreContacts.go
with
13 additions
and
3 deletions
bindings/restoreContacts.go
+
13
−
3
View file @
6fe18101
...
@@ -29,6 +29,7 @@ type RestoreContactsReport struct {
...
@@ -29,6 +29,7 @@ type RestoreContactsReport struct {
restored
[]
*
id
.
ID
restored
[]
*
id
.
ID
failed
[]
*
id
.
ID
failed
[]
*
id
.
ID
errs
[]
error
errs
[]
error
restErr
error
}
}
// LenRestored returns the length of ID's restored.
// LenRestored returns the length of ID's restored.
...
@@ -56,6 +57,14 @@ func (r *RestoreContactsReport) GetErrorAt(index int) string {
...
@@ -56,6 +57,14 @@ func (r *RestoreContactsReport) GetErrorAt(index int) string {
return
r
.
errs
[
index
]
.
Error
()
return
r
.
errs
[
index
]
.
Error
()
}
}
// GetRestoreContactsError returns an error string. Empty if no error.
func
(
r
*
RestoreContactsReport
)
GetRestoreContactsError
()
string
{
if
r
.
restErr
==
nil
{
return
""
}
return
r
.
restErr
.
Error
()
}
// RestoreContactsFromBackup takes as input the jason output of the
// RestoreContactsFromBackup takes as input the jason output of the
// `NewClientFromBackup` function, unmarshals it into IDs, looks up
// `NewClientFromBackup` function, unmarshals it into IDs, looks up
// each ID in user discovery, and initiates a session reset request.
// each ID in user discovery, and initiates a session reset request.
...
@@ -65,8 +74,8 @@ func (r *RestoreContactsReport) GetErrorAt(index int) string {
...
@@ -65,8 +74,8 @@ func (r *RestoreContactsReport) GetErrorAt(index int) string {
// the mobile phone apps and are not intended to be part of the xxDK. It
// the mobile phone apps and are not intended to be part of the xxDK. It
// should be treated as internal functions specific to the phone apps.
// should be treated as internal functions specific to the phone apps.
func
RestoreContactsFromBackup
(
backupPartnerIDs
[]
byte
,
client
*
Client
,
func
RestoreContactsFromBackup
(
backupPartnerIDs
[]
byte
,
client
*
Client
,
udManager
*
UserDiscovery
,
updatesCb
RestoreContactsUpdater
)
(
udManager
*
UserDiscovery
,
*
RestoreContacts
Report
,
err
or
)
{
updatesCb
RestoreContacts
Updater
)
*
RestoreContactsRep
or
t
{
restored
,
failed
,
errs
,
err
:=
xxmutils
.
RestoreContactsFromBackup
(
restored
,
failed
,
errs
,
err
:=
xxmutils
.
RestoreContactsFromBackup
(
backupPartnerIDs
,
&
client
.
api
,
udManager
.
ud
,
updatesCb
)
backupPartnerIDs
,
&
client
.
api
,
udManager
.
ud
,
updatesCb
)
...
@@ -75,6 +84,7 @@ func RestoreContactsFromBackup(backupPartnerIDs []byte, client *Client,
...
@@ -75,6 +84,7 @@ func RestoreContactsFromBackup(backupPartnerIDs []byte, client *Client,
restored
:
restored
,
restored
:
restored
,
failed
:
failed
,
failed
:
failed
,
errs
:
errs
,
errs
:
errs
,
},
err
restErr
:
err
,
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment