Repository navigation
Conversation
…tadata The relay republishes kind:39000 on every edit, membership change and discovery repair, so its event time moved a chat to the top of Recent. Read the NIP-CL created_at tag instead, falling back to the event time for events that predate it. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost> Signed-off-by: Tom Brow <tomb@block.xyz>
Accept the tag only as desktop does (an unsigned decimal of at most 16 digits) and within DateTime's range. Signed-off-by: Tom Brow <tomb@block.xyz>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mobile took a channel's creation time from the kind:39000 event's own
created_at. The relay republishes 39000 on every metadata edit, membership change (an agent joining a DM, for example) and discovery repair, so each of those made the chat look newly created and moved it to the top of a list sorted by Recent, with no new message.NIP-CL says to use the
created_attag for a channel's age; the relay writes it on every 39000 and it doesn't change on republish. Mobile now:ChannelData.createdAt(unix seconds), falling back to the event time when the tag is missing or malformed, as on events an older relay published (NIP-CL "Older events"), andChannel.createdAtin both places that build a channel from 39000 (the channel list and channel details).Follow-up to #10084, which stopped the relay's repair from rewriting a live 39000; this covers the other republish paths on the client.
Validation
a channel is as old as its created_at tag, not its latest metadataloads one channel whose tag is older than its latest metadata and one without the tag, and checks each channel'screatedAt.channelDetailsFromEvent's tag test now also checkscreatedAtcomes from the tag.Regressions