Skip to content

fix(mobile): date channels by their created_at tag, not the latest metadata - #10114

Draft
brow wants to merge 2 commits into
mainfrom
mobile-channel-created-at-tag
Draft

brow wants to merge 2 commits into
mainfrom
mobile-channel-created-at-tag

Conversation

@brow

@brow brow commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

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_at tag for a channel's age; the relay writes it on every 39000 and it doesn't change on republish. Mobile now:

  • parses that tag into 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"), and
  • uses it as Channel.createdAt in 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 metadata loads one channel whose tag is older than its latest metadata and one without the tag, and checks each channel's createdAt.
  • channelDetailsFromEvent's tag test now also checks createdAt comes from the tag.
  • iOS simulator (iPhone 17 Pro), signed in to a Builderlab test account, Team list sorted by Recent. Before (main): editing an older channel's description moved it from 4th to the top. After (this branch): editing another older channel's description left it in place. Covered on the way: channel list, opening a channel, channel details and the edit sheet. Screenshots aren't attached because the list shows a real community's channel names.

Regressions

  • Sort order: a chat with no messages now sorts by when it was created instead of when its metadata last changed. That is the intended fix; a chat that was edited recently no longer jumps up.
  • Older relays: without the tag, behavior is unchanged.

brow and others added 2 commits December 1, 2026 20:03
…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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant