Skip to content

Commit

Permalink
Treat "malformed" contact events as no data
Browse files Browse the repository at this point in the history
The format of those events is not covered by a NIP and is a hack, for
our use case we should just treat this as a "no data" scenario.
  • Loading branch information
boreq committed Nov 15, 2023
1 parent 2369545 commit 91cc1b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion service/adapters/purple_pages.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,12 @@ func (p *PurplePages) getRelaysFromContacts(ctx context.Context, publicKey domai
case domain.EventKindContacts:
result, err := domain.GetRelaysFromContactsEvent(event)
if err != nil {
return nil, errors.Wrap(err, "error getting contacts from event")
p.logger.
Debug().
WithError(err).
WithField("eventContent", event.Content()).
Message("error extracting relays from contacts event")
return nil, errLookupFoundNoEvents
}
return result, nil
default:
Expand Down

0 comments on commit 91cc1b2

Please sign in to comment.