Skip to content

perf(mobile): keep latest-message times on a directory load - #9457

Merged
brow merged 3 commits into
mainfrom
tomb/mobile-directory-keep-latest
Nov 13, 2026
Merged

brow merged 3 commits into
mainfrom
tomb/mobile-directory-keep-latest

Conversation

@brow

@brow brow commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Opening search loads the channel directory when it is older than 30 seconds. That load reruns the whole channel list read, including each channel's latest messages (up to 20 per channel, 1 per DM), even though the list is already showing and its live subscriptions keep those times current. On an iPhone 12 mini signed in to Block's Builderlab, the latest-message part was about 700 KB of every search open.

A directory load now skips the latest-message read when a channel list is already loaded and keeps the loaded times, the same as the background list reads already do. The first load, when no list is showing yet, still reads them. Both reads still fetch latest messages for member channels the list did not already show (for example a DM opened on another device), so those get a time instead of sorting last in Recent; before, background list reads left them without one. If that read hits the relay deadline, the list is marked for a full read and retried with backoff, as a timed-out full read was before.

Validation

New test: with a loaded list, a directory load sends no latest-message requests, adds the directory channel and keeps the member channel's latest-message time. It fails without this change. A second test: a DM first listed by a directory load, holding only our own message (which unread catch-up skips), gets its latest-message time. It fails without the newly-listed read. Its deadline row (the read that first lists the DM times out) checks that the backoff retry dates the DM; it fails if either the revalidation flag or the retry is removed.

Full mobile test suite, flutter analyze and the file-size check pass. To stay under the 1200-line limit, _advanceLastMessageAt moved unchanged into channel_unread_catch_up.dart.

On the iPhone 12 mini (profile build, signed in to Builderlab), opening search 90 seconds after a cold start and typing "buzz":

Latest messages All relay HTTP
Before 704 KB 3.56 MB
After 0 2.86 MB

The automated run covered a cold start, the home list, opening search, channel results for the query, and closing search back to the home list with the same order.

Regressions

  • A directory load with a loaded list no longer refreshes cached DM display names; the next full list read (pull to refresh, cold start, or a channel action) still does, as for background list reads.
  • A latest-message time the live subscriptions missed (for example while the socket was down) is not corrected by opening search; the next full list read corrects it.

Opening search reloads the directory, which reran the whole channel list
read including every channel's latest messages, though the loaded list's
live subscriptions keep those times current. Skip that read when a list
is already loaded, as background list reads do.

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:15:11.472849Z 94a7d9f 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: dad3b71b8d

ℹ️ 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 list read that keeps the loaded times skipped the latest-message read
for every channel, so a DM first listed by that read (for example one
opened on another device) had no time and sorted last in Recent until
the next full read. Read latest messages for member channels the list
did not already show as member channels, and keep the later of the
known and fetched times.

Signed-off-by: Tom Brow <[email protected]>
A targeted latest-message batch that hit the relay deadline left a newly
listed channel undated, and later reads skipped it because it was now
listed. Any unavailable batch now marks the list for a full read and
schedules the bounded list-read retry, as a timed-out full batch did
before this PR.

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. Hooray!

Reviewed commit: 94a7d9f405

ℹ️ 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 19:13
@brow
brow requested a review from a team as a code owner November 13, 2026 19:13
@brow
brow deployed to codex-review November 13, 2026 19:13 — 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...94a7d9f405e86b3d6b5439b33d9e2bbd3f9e16fc
  • 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 findings identified in the authorized PR range.

Findings

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

Notes

  • Reviewed through read-only source and history inspection. Builds and tests were not run, as requested.

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 237a39f into main Nov 13, 2026
60 checks passed
@brow
brow deleted the tomb/mobile-directory-keep-latest branch November 13, 2026 21:39
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

This branch was successfully deployed

1 active deployment
codex-review — 94a7d9f4 Deployed Nov 13, 2026 by brow via Run Codex Security Review #15015
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