Skip to content
Snippets Groups Projects
Commit fd0ce8b5 authored by Josh Brooks's avatar Josh Brooks
Browse files

Add more debugs

parent 3398652d
Branches
No related tags found
1 merge request!399Add initial debug prints
...@@ -41,6 +41,7 @@ func RestoreContactsFromBackup(backupPartnerIDs []byte, user *xxdk.E2e, ...@@ -41,6 +41,7 @@ func RestoreContactsFromBackup(backupPartnerIDs []byte, user *xxdk.E2e,
udManager *ud.Manager, udManager *ud.Manager,
updatesCb interfaces.RestoreContactsUpdater) ([]*id.ID, []*id.ID, updatesCb interfaces.RestoreContactsUpdater) ([]*id.ID, []*id.ID,
[]error, error) { []error, error) {
jww.INFO.Printf("RestoreContactsFromBackup(%s)", backupPartnerIDs)
var restored, failed []*id.ID var restored, failed []*id.ID
var errs []error var errs []error
...@@ -52,6 +53,12 @@ func RestoreContactsFromBackup(backupPartnerIDs []byte, user *xxdk.E2e, ...@@ -52,6 +53,12 @@ func RestoreContactsFromBackup(backupPartnerIDs []byte, user *xxdk.E2e,
update := func(numFound, numRestored, total int, err string) { update := func(numFound, numRestored, total int, err string) {
if updatesCb != nil { if updatesCb != nil {
jww.INFO.Printf("Reporting restored contacts with:"+
"\n\tNumber found: %d"+
"\n\tNumber restored: %d"+
"\n\tTotal: %d"+
"\n\tError: %v\n",
numFound, numRestored, total, err)
updatesCb.RestoreContactsCallback(numFound, numRestored, updatesCb.RestoreContactsCallback(numFound, numRestored,
total, err) total, err)
} }
...@@ -68,6 +75,12 @@ func RestoreContactsFromBackup(backupPartnerIDs []byte, user *xxdk.E2e, ...@@ -68,6 +75,12 @@ func RestoreContactsFromBackup(backupPartnerIDs []byte, user *xxdk.E2e,
} }
lookupIDs, resetContacts, restored := checkRestoreState(idList, store) lookupIDs, resetContacts, restored := checkRestoreState(idList, store)
jww.INFO.Printf("Check restore state results:"+
"\n\tLookupIds: %v"+
"\n\tContacts: %v"+
"\n\tRestored IDs: %v\n",
lookupIDs, resetContacts, restored)
// State variables, how many we have looked up successfully // State variables, how many we have looked up successfully
// and how many we have already reset. // and how many we have already reset.
totalCnt := len(idList) totalCnt := len(idList)
...@@ -177,6 +190,7 @@ func LookupContacts(in chan *id.ID, out chan *contact.Contact, ...@@ -177,6 +190,7 @@ func LookupContacts(in chan *id.ID, out chan *contact.Contact,
failCh chan failure, user *xxdk.E2e, udContact contact.Contact, failCh chan failure, user *xxdk.E2e, udContact contact.Contact,
wg *sync.WaitGroup) { wg *sync.WaitGroup) {
defer wg.Done() defer wg.Done()
jww.INFO.Printf("Looking up backed up contacts...")
// Start looking up contacts with user discovery and feed this // Start looking up contacts with user discovery and feed this
// contacts channel. // contacts channel.
for lookupID := range in { for lookupID := range in {
...@@ -191,7 +205,7 @@ func LookupContacts(in chan *id.ID, out chan *contact.Contact, ...@@ -191,7 +205,7 @@ func LookupContacts(in chan *id.ID, out chan *contact.Contact,
failCh <- failure{ID: lookupID, Err: err} failCh <- failure{ID: lookupID, Err: err}
continue continue
} }
jww.WARN.Printf("could not lookup %s: %v", lookupID, err) jww.WARN.Printf("Could not lookup %s: %v", lookupID, err)
} }
} }
...@@ -204,6 +218,7 @@ func ResetSessions(in, out chan *contact.Contact, failCh chan failure, ...@@ -204,6 +218,7 @@ func ResetSessions(in, out chan *contact.Contact, failCh chan failure,
user *xxdk.E2e, wg *sync.WaitGroup) { user *xxdk.E2e, wg *sync.WaitGroup) {
defer wg.Done() defer wg.Done()
for c := range in { for c := range in {
jww.INFO.Printf("Resetting contact with partner ID %s", c.ID)
_, err := user.GetAuth().Reset(*c) _, err := user.GetAuth().Reset(*c)
if err == nil { if err == nil {
out <- c out <- c
...@@ -222,6 +237,8 @@ func ResetSessions(in, out chan *contact.Contact, failCh chan failure, ...@@ -222,6 +237,8 @@ func ResetSessions(in, out chan *contact.Contact, failCh chan failure,
// should be treated as internal functions specific to the phone apps. // should be treated as internal functions specific to the phone apps.
func LookupContact(userID *id.ID, user *xxdk.E2e, udContact contact.Contact) ( func LookupContact(userID *id.ID, user *xxdk.E2e, udContact contact.Contact) (
*contact.Contact, error) { *contact.Contact, error) {
jww.DEBUG.Printf("Looking up contact with ID %s", userID)
// This is a little wonky, but wait until we get called then // This is a little wonky, but wait until we get called then
// set the result to the contact objects details if there is // set the result to the contact objects details if there is
// no error // no error
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment