diff --git a/ud/store/facts.go b/ud/store/facts.go index 27e4545336632cb2527040a5fd5af0da68133ac3..5ffb505b42bba578f3f49d2e807ae7debc43942d 100644 --- a/ud/store/facts.go +++ b/ud/store/facts.go @@ -70,8 +70,12 @@ func (s *Store) GetUsername() (string, error) { // todo: refactor this in the future so that // it's an O(1) lookup (place this object in another map // or have it's own field) + jww.INFO.Printf("USERNAME BACKUP DEBUG (GetUsername): map: %+v", s.confirmedFacts) + for f := range s.confirmedFacts { if f.T == fact.Username { + jww.INFO.Printf("USERNAME BACKUP DEBUG (GetUsername): found fact: %+v", f) + return f.Fact, nil } } @@ -174,12 +178,12 @@ func (s *Store) BackUpMissingFacts(username, email, phone fact.Fact) error { } } + jww.INFO.Printf("USERNAME BACKUP DEBUG (BackUpMissingFacts): fact map after %+v", s.confirmedFacts) + if modified { return s.saveConfirmedFacts() } - jww.INFO.Printf("USERNAME BACKUP DEBUG (BackUpMissingFacts): fact map after %+v", s.confirmedFacts) - return nil }