You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NIP-CL membership_snapshot: add a per-channel roster version so clients can refresh only changed rosters #9361
A client in about 1,500 channels starts with the compact membership snapshot (kind 39008, #9118). After that, it wants to fetch only the 39002 rosters that changed since its last start.
What's missing
Each snapshot row carries {id, role, channel_type, visibility, archived}, plus one snapshot_id for the whole snapshot. snapshot_id is a hash of the viewer's own rows. It changes when the viewer's own membership changes, but not when another member joins or leaves a channel.
So a client that keeps rosters (member lists, for names and mentions) can't tell from the snapshot which of its saved 39002s are stale. It has to fetch every roster again: in our measurements that is tens of MB per start for a user in about 1,500 channels with about 290 members each.
Proposal
Add an optional per-row roster version, for example roster: "<39002 event id>" (or roster_at: <created_at>), to each 39008 row. A relay that advertises it in NIP-11 lets a client:
read 39008 once (about 200 KB for 1,500 channels);
compare each row's roster version with its saved copy;
fetch only the changed 39002s by ids.
Why not elsewhere
In our fork we did this with a separate REQ extension (group_heads: 1, which returns {d, id, created_at} per 39002). That costs about 0.21 MB for 1,500 groups, against 25 MB for the full rosters. Folding it into NIP-CL would avoid a second, relay-specific read path. It would also keep guests scoped by the same rules as 39008.
Activity