this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

identity: small improvements (#458)

I'm not sure why the error wasn't getting returned; might have been a
typo? Probably worth re-reading that function again in review. I hit a
nil de-reference pointer in automod caused by that function returning
`nil, nil`.

authored by

bnewbold and committed by
GitHub
81f67da3 77d80d37

+5 -1
+1
atproto/identity/base_directory.go
··· 33 33 var _ Directory = (*BaseDirectory)(nil) 34 34 35 35 func (d *BaseDirectory) LookupHandle(ctx context.Context, h syntax.Handle) (*Identity, error) { 36 + h = h.Normalize() 36 37 did, err := d.ResolveHandle(ctx, h) 37 38 if err != nil { 38 39 return nil, err
+3 -1
atproto/identity/cache_directory.go
··· 181 181 if he != nil { 182 182 d.handleCache.Add(ident.Handle, *he) 183 183 } 184 - return &entry, nil 184 + return &entry, err 185 185 } 186 186 187 187 func (d *CacheDirectory) LookupDID(ctx context.Context, did syntax.DID) (*Identity, error) { ··· 226 226 } 227 227 228 228 func (d *CacheDirectory) LookupHandle(ctx context.Context, h syntax.Handle) (*Identity, error) { 229 + h = h.Normalize() 229 230 did, err := d.ResolveHandle(ctx, h) 230 231 if err != nil { 231 232 return nil, err ··· 260 261 func (d *CacheDirectory) Purge(ctx context.Context, a syntax.AtIdentifier) error { 261 262 handle, err := a.AsHandle() 262 263 if nil == err { // if not an error, is a handle 264 + handle = handle.Normalize() 263 265 d.handleCache.Remove(handle) 264 266 return nil 265 267 }
+1
atproto/identity/mock_directory.go
··· 30 30 } 31 31 32 32 func (d *MockDirectory) LookupHandle(ctx context.Context, h syntax.Handle) (*Identity, error) { 33 + h = h.Normalize() 33 34 did, ok := d.Handles[h] 34 35 if !ok { 35 36 return nil, ErrHandleNotFound