From 8a590beccaf5a77ce60d2dcf0ab29ef91b239d90 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Wed, 13 Sep 2023 01:28:32 -0700 Subject: [PATCH] identity: handle errors when doing LookupDID should not error, just invalid handle --- atproto/identity/base_directory.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/atproto/identity/base_directory.go b/atproto/identity/base_directory.go index 29323f38d..5b509210b 100644 --- a/atproto/identity/base_directory.go +++ b/atproto/identity/base_directory.go @@ -61,10 +61,11 @@ func (d *BaseDirectory) LookupDID(ctx context.Context, did syntax.DID) (*Identit return nil, err } resolvedDID, err := d.ResolveHandle(ctx, declared) - if err != nil { + if err != nil && err != ErrHandleNotFound { return nil, err - } - if resolvedDID == did { + } else if ErrHandleNotFound == err || resolvedDID != did { + ident.Handle = syntax.Handle("handle.invalid") + } else { ident.Handle = declared }