Skip to content

perf(mobile): keep verified-name batches open as people are added - #9450

Merged
brow merged 2 commits into
mainfrom
tomb/mobile-verified-stable-batches
Nov 13, 2026
Merged

brow merged 2 commits into
mainfrom
tomb/mobile-verified-stable-batches

Conversation

@brow

@brow brow commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Verified names are read in subscriptions of up to 128 people. Each time someone new was tracked, the batches were rebuilt from the whole tracked list, so the last partial batch got a new identity, was closed, and was reopened with everyone in it plus the newcomer. Profiles show up a few at a time (search results, channel members, mentions), so the same records were read again and again. Past 1,024 tracked people, each newcomer evicts the oldest, which shifts every batch boundary, so every batch was closed and all 1,024 records were read again.

Now an open batch stays open as long as all its people are still tracked. Newly tracked people get a batch of their own. A batch that loses someone to eviction, or that the relay retried, is replaced as before, and so is a batch whose person was evicted and tracked again before the batch was re-checked, so their check mark and cached name are re-read. Once four batches are smaller than 128, the next addition merges the smallest of them with the newcomers until they fill a batch (at least one, so no fifth small batch appears). The subscription count stays within four of the minimum, and a merge re-reads at most 128 plus the largest small batch.

People already checked also stay checked while a newcomer's batch opens; before, the reopened batch briefly unchecked them.

Validation

New tests: tracking one more person opens a batch with only that person, and the people already checked stay checked throughout; with four small batches of 64 open, one more person merges two of them into a full batch and leaves the other two open; a large addition past four small batches still retires one; tracking one more person at the 1,024 limit re-reads only the batch that lost the oldest person; a person evicted and tracked again before the sync is re-read and checked; and a re-tracked person keeps their verified name when the cached-name limit trims it. Existing batch, eviction, retry and reconnect tests pass unchanged (one comment updated). Full mobile test suite and flutter analyze pass.

On an iPhone 12 mini signed in to Block's Builderlab (instrumented profile build of e2fb02c), opening search and typing "presence" after opening a channel and a thread: verified-name reads went from 21 subscriptions and 328 KB before this change to 11 and 88 KB with it (counted per subscription opened; the first revision measured the same way gave 11 and 90 KB).

The same automated run covered cold start, opening the-squad and one of its threads, search with the People filter, opening buzz-mobile's details and scrolling its full 86-person member list, and a 60 s background then resume (the resync re-read 2 batches, 65 KB). Names rendered throughout.

Regressions

Up to four more open subscriptions while small batches accumulate, each held open by the relay like the existing ones. A community with under 128 tracked people now has up to five instead of one. No merge policy reads less than the old slicing on every sequence of additions. In a model of 3,000 random tracking sequences, this one read more records than the old code in about 1 sequence in 500, by at most a quarter.

Each newly tracked person rebuilt every batch from the whole tracked list,
so the last batch was closed and read again with everyone in it, and past
1,024 people every eviction shifted every batch and re-read all of them.
Keep intact batches open, read newcomers in a batch of their own, and merge
small batches once four are open.

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-13T20:28:16.145943Z e2fb02c 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: 249020be08

ℹ️ 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".

At the four-partial cap, retire the smallest partial batches only until
the new subjects fill a batch (at least one when they would leave a
partial of their own), instead of re-reading every partial.

Replace a batch whose subject was evicted and tracked again before the
sync, so its check mark and any pruned cached head are restored.

Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost>
Signed-off-by: Tom Brow <[email protected]>
@brow

brow commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: e2fb02ce0b

ℹ️ 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".

@brow
brow marked this pull request as ready for review November 13, 2026 20:26
@brow
brow requested a review from a team as a code owner November 13, 2026 20:26
@brow
brow deployed to codex-review November 13, 2026 20:26 — 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...e2fb02ce0bcea235dee5d4deda42f3b3eb25718b
  • 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 changes.

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 with no comments.

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

@brow
brow merged commit 93bbd45 into main Nov 13, 2026
60 checks passed
@brow
brow deleted the tomb/mobile-verified-stable-batches branch November 13, 2026 21: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 — e2fb02ce Deployed Nov 13, 2026 by brow via Run Codex Security Review #15051
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