Skip to content

perf(mobile): load only the directory when search opens - #9466

Merged
brow merged 2 commits into
mainfrom
tomb/mobile-search-directory-only
Nov 13, 2026
Merged

brow merged 2 commits into
mainfrom
tomb/mobile-search-directory-only

Conversation

@brow

@brow brow commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Opening search on a list that is already loaded refreshed the whole channel list to get the open-channel directory: the membership rosters (kind 39002), member channel metadata, hidden DMs, Huddle starts, DM names and the latest messages of every joined channel, then the directory pages. Only the directory was what search needed; everything else was already in the list and kept current by live updates.

Search now reads only the directory pages and merges them into the current list: every channel you are not a member of is rebuilt from the fresh directory (latest revision per channel, open and non-DM only, the same rules as a full refresh), and joined channels keep their entries untouched. When the list has not loaded yet, the full refresh runs as before.

Races:

  • A directory-only load is fenced by scope alone (community, identity, disposal), not by the list-refresh generation, so it neither retires an in-flight membership refresh nor is retired by one. A community or identity switch retires it: its response is discarded and it no longer owns its loading status, so returning to the first community (before or after the old request ends) lets search load the directory again.
  • Directory loads are ordered among themselves: only the newest one writes the directory and its load status, so an older full refresh cannot overwrite a newer search load and vice versa.
  • A list refresh that merged an older directory and then installs after a search load landed re-merges the newer directory, so the open channel search just found does not disappear.
  • A list refresh no longer resets a live directory-only load's status to idle (that reset existed because a refresh used to discard the in-flight directory, which it no longer does for this kind of load). A load retired by a scope switch is not live, so the reset still applies to the status it left behind.

Results

iPhone 12 mini, profile build, Builderlab account. Typing a query into search on a loaded list, more than 30 seconds after the last directory load (two runs each, same numbers both times):

HTTP per search What it read
main 3.59 MB rosters 1.53 MB, channel metadata and directory 1.26 MB, latest messages 0.80 MB
This change 1.26 MB directory pages only

Unjoined open channels still appear in results with their Open badge.

Regressions

The tradeoff we accept: on a search open, joined channels' member counts, unread badges and latest-message times are not re-read; they show what the last full refresh found, as updated by live events since. Live join and leave notices, metadata changes and new messages still apply as they arrive, and the next ordinary refresh (launch, reconnect, resume, pull to refresh) re-reads everything. The case that differs is a change that live delivery missed on a healthy connection (for example a roster change made while a live chunk was briefly refused): before, opening search happened to repair it; now the next ordinary refresh does.

Nothing else changes: open channels are listed under the same visibility rules, a failed directory load still reports its error to search and keeps the cached discovery, and the first load is unchanged.

Testing

  • Full mobile suite passes; flutter analyze clean.
  • New tests: a search load on a loaded list issues only directory queries (no roster, member metadata, hidden-DM, Huddle or message reads), lists the new open channel, drops one that became private and keeps the joined channel object unchanged; a membership refresh during the load is kept and does not reset its status; a list refresh that merged the directory before a search load landed keeps the newer directory; a community switch discards the response; returning to the first community, both while the old request is in flight and after it ended, loads the directory again.
  • Automated device run on the iPhone 12 mini: launch, two search sessions typing a query, results list joined and unjoined open channels, close and reopen search. Rerun on f216dd6 (after the scope-switch fix) with the same results: 1.26 MB HTTP per query, unjoined open channels marked Open.

Opening search on a loaded list now reads only the kind:39000 directory
and merges it into the current list. Joined channels keep their entries,
and non-member open channels are rebuilt with the same visibility rules
as a full refresh. The first load still takes the full path.

A directory-only load does not retire an in-flight membership refresh.
A refresh that merged an older directory re-applies the newer one before
it installs its list, a newer directory load wins over an older one, and
a scope switch discards the response.

Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Signed-off-by: Tom Brow <[email protected]>
@brow

brow commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T19:10:46.252761Z f216dd6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: ba0d0a5ed2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A directory-only search load kept its ownership marker after a community
or identity switch retired it. On returning to the first community, the
list refresh treated the abandoned loading status as owned by a live load
and left it in place, so search never loaded the directory again.

A scope switch now retires directory-only loads too: it advances the
directory generation and clears the marker. Tests cover returning both
while the old request is in flight and after it ended.

Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Signed-off-by: Tom Brow <[email protected]>
@brow
brow marked this pull request as ready for review November 13, 2026 19:08
@brow
brow requested a review from a team as a code owner November 13, 2026 19:08
@brow
brow deployed to codex-review November 13, 2026 19:08 — with GitHub Actions Active
@github-actions github-actions Bot added the codex-security-review-current The posted Codex security review matches its recorded range. label Nov 13, 2026
@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Note: This is an automated, security-focused review generated by Codex.
Use it as a supplement to human review; false positives are possible.

Scope

  • Exact PR diff: 59ae028a360242d43ffbfdafca8a76eda00484d9...f216dd6afc3f38f509b2c73e44824acf4ec785b5
  • Model: gpt-6.1-sol

💡 Click "edited" above to see earlier reviews for this PR.


Review Summary

Overall Risk: NONE

No concrete security, correctness, or reliability regressions found in the authorized PR range.

Findings

No concrete security, correctness, or reliability findings were identified.

Notes

  • Review used read-only inspection of the diff, surrounding source, callers, tests, and history. Builds and tests were not executed.

Generated by Codex Security Review |
Requested by: @brow |
Workflow run

@kazemek21 kazemek21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kyle reviewed this PR and the Nexus review-tracker notes and approved without comments.

Posted by Codex (gpt-6.1-sol) on behalf of kylez.

@brow
brow merged commit c97c85d into main Nov 13, 2026
60 checks passed
@brow
brow deleted the tomb/mobile-search-directory-only branch November 13, 2026 22:40
wpfleger96 added a commit that referenced this pull request Nov 14, 2026
* origin/main: (24 commits)
  docs(readme): point desktop readers at block/buzz-app and describe where each client lives (#9493)
  test(cli,db): freeze the assertion test clock and give pool release tests a test-lane acquire budget (#9442)
  test(desktop): unmount every TerminalSubstrate tree before the window closes (#9440)
  fix(mobile): drop the iOS share extension from the build until it's signed (#9489)
  chore(release): release Buzz Desktop version 0.5.30 (#9491)
  perf(mobile): parse each event's thread reference once (#9460)
  perf(mobile): load only the directory when search opens (#9466)
  perf(mobile): stop rebuilding Home's channel list when a route covers it (#9459)
  perf(mobile): ask typing subscriptions only for the typing window (#9454)
  perf(mobile): skip avatar URL parsing for non-HTTP URLs (#9448)
  perf(mobile): download the identity archive list only when it changed (#9445)
  perf(mobile): don't treat a Control Center pull as a resume (#9443)
  fix(mobile): keep a superseded roster read out of the offline snapshot (#9452)
  perf(mobile): read channel bot roles from the member list (#9451)
  perf(mobile): read Activity once per reconnect (#9455)
  fix(mobile): offer role controls for agents (#9475)
  perf(mobile): stop rebuilding the native nav bar on every scrolled frame (#9458)
  perf(mobile): keep verified-name batches open as people are added (#9450)
  perf(mobile): read only changed custom emoji sets on reconnect (#9446)
  perf(mobile): keep latest-message times on a directory load (#9457)
  ...

Signed-off-by: Will Pfleger <[email protected]>

# Conflicts:
#	crates/buzz-cli/src/desktop_provider.rs
bostonaholic added a commit that referenced this pull request Nov 14, 2026
…eaction-recipients

* origin/main: (111 commits)
  perf(acp): avoid repeated observer batch serialization (#9483)
  docs(readme): point desktop readers at block/buzz-app and describe where each client lives (#9493)
  test(cli,db): freeze the assertion test clock and give pool release tests a test-lane acquire budget (#9442)
  test(desktop): unmount every TerminalSubstrate tree before the window closes (#9440)
  fix(mobile): drop the iOS share extension from the build until it's signed (#9489)
  chore(release): release Buzz Desktop version 0.5.30 (#9491)
  perf(mobile): parse each event's thread reference once (#9460)
  perf(mobile): load only the directory when search opens (#9466)
  perf(mobile): stop rebuilding Home's channel list when a route covers it (#9459)
  perf(mobile): ask typing subscriptions only for the typing window (#9454)
  perf(mobile): skip avatar URL parsing for non-HTTP URLs (#9448)
  perf(mobile): download the identity archive list only when it changed (#9445)
  perf(mobile): don't treat a Control Center pull as a resume (#9443)
  fix(mobile): keep a superseded roster read out of the offline snapshot (#9452)
  perf(mobile): read channel bot roles from the member list (#9451)
  perf(mobile): read Activity once per reconnect (#9455)
  fix(mobile): offer role controls for agents (#9475)
  perf(mobile): stop rebuilding the native nav bar on every scrolled frame (#9458)
  perf(mobile): keep verified-name batches open as people are added (#9450)
  perf(mobile): read only changed custom emoji sets on reconnect (#9446)
  ...

Signed-off-by: Matthew Boston <[email protected]>

This branch was successfully deployed

1 active deployment
codex-review — f216dd6a Deployed Nov 13, 2026 by brow via Run Codex Security Review #15011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex-security-review-current The posted Codex security review matches its recorded range.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants