Skip to content

fix(channels): read metadata for a labeled channel whose roster came first - #1289

Draft
loganj wants to merge 1 commit into
mainfrom
larry/system-channel-lookup
Draft

loganj wants to merge 1 commit into
mainfrom
larry/system-channel-lookup

Conversation

@loganj

@loganj loganj commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

🤖

Summary

  • Looking up a channel by its creator and label (for example, a plugin finding its records channel) could intermittently return nothing for a channel the viewer had just been added to.
  • Cause: the app first learns which channels the viewer belongs to, and reads their names and labels a moment later. If a lookup ran in that short window, the app treated the channel as already known, skipped re-reading it, and then dropped it because it had no labels yet.
  • The lookup now re-reads such a channel. Search and other callers keep their current behavior.

Details

  • findLabeled passes a new unnamed flag to resolve, which then also reads authorized channels whose metadata has not arrived. The flag is local to the lookup because search and membership hints rely on the existing filter (their tests read exactly the channels they expect).
  • The evidence points to the app, not to relay replica lag. The fix changes only what the app does after the relay answers the label query, and it removed the misses on staging (see Testing). A lagging relay answer would still miss with the fix.

Related issue

None found. Found while testing system channels on staging.

Testing

  • New unit test in store-discovery.test.ts puts the store in that window (roster known, metadata not yet read) and checks the lookup finds the channel. It fails without the fix.
  • Against the staging relay, with the lookup run right after the channel appeared (and before its labels arrived, in every run): without the fix 1 of 8 lookups returned nothing; with the fix 32 of 32 found the channel.

…first

A full discovery pass applies the viewer's rosters before it reads channel
names. A channel admitted by its roster alone has no creator or labels yet,
and findLabeled skipped re-reading it because the store already authorized
it. A lookup in that window returned nothing.

findLabeled now asks resolve to read authorized channels whose metadata has
not arrived. Search and membership hints keep the old filter.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
@loganj
loganj force-pushed the larry/system-channel-lookup branch from ac3cf92 to 66bcdd2 Compare October 18, 2026 04:12
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