-
Notifications
You must be signed in to change notification settings - Fork 296
Add relay hints to tags and identifiers #3137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| if let quoted_ev = state.events.lookup(ev.id) { | ||
| tags.append(["p", quoted_ev.pubkey.hex()]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't understand this code. Why do a lookup again when we already have the quoted event pubkey? Seems like a bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure, looks like an oversight or the result of a refactor. removing it looks fine to me
Changelog-Added: Add relay hints to tags and identifiers Signed-off-by: Terry Yiu <git@tyiu.xyz>
jb55
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
| if let quoted_ev = state.events.lookup(ev.id) { | ||
| tags.append(["p", quoted_ev.pubkey.hex()]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure, looks like an oversight or the result of a refactor. removing it looks fine to me
danieldaquino
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @tyiu, looks good!
Summary
This PR adds relay hints to tags and identifiers to improve content discovery on the network. Previously, we were referencing identifiers without them, so other clients would need to guess where to look for that content, leading to a broken user experience.
This PR does not take care of all the places that could have relay hints added. It only adds the ones where it's convenient. To fully tackle the rest, we would need a fundamental change in some of the core code.
Checklist
Closes:orFixes:tags in the commit messages wherever applicable, or made sure those are not needed. See Submitting patchesTest report
Device: iPhone 16 Pro Simulator
iOS: 18.5
Damus: 96cd6dc
Steps:
...menu, and tapCopy note ID.neventinstead of anote1identifier now.neventidentifier into search and observe that note appear.Copy Link.nevent. This has not changed, but the selection of relays now prefers actual relays that we found the event from first.Share Linkinstead.Results: