Repository navigation
perf(mobile): read only changed custom emoji sets on reconnect - #9446
Conversation
Every reconnect refetched every member's kind 30030 emoji set (about 1 MB on Builderlab). Keep the sets read so far and ask only for sets written since shortly before the previous read. Watch only the session status, not the whole session state. Signed-off-by: Tom Brow <[email protected]>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ff54c1679
ℹ️ 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".
The relay replaces an addressable event at the same created_at when the new id is lower; the palette kept the old set. Also keep the union until a set changes, so a reconnect with nothing new republishes the same list. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost> Signed-off-by: Tom Brow <[email protected]>
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🔐 Codex Security Review
Review SummaryOverall Risk: MEDIUM
Findings[MEDIUM]
|
kazemek21
left a comment
There was a problem hiding this comment.
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
* 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
…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]>
Once anything has read the custom emoji palette (opening any channel does), every reconnect refetches every member's kind 30030 emoji set. On Block's Builderlab that is 123 sets, about 1 MB, on every resume, though the sets rarely change. The provider also watched the whole session state, not just its status.
The palette now keeps the sets it has read per author and, on a reconnect, asks only for sets written since shortly before the previous read (
sincereaching backrelayCrossDeviceSkewSeconds, the window the unread catch-up already uses for events other devices write). A newer set replaces the known one for its author, with the relay's order for a same-second tie (the lower event id wins); the palette is the union as before, recomputed only when a set changes, so a reconnect that brings nothing new republishes the identical list and rebuilds nothing. A community or account switch (a new relay client) starts over with a full read.Two side benefits: the loaded palette stays visible while disconnected (before, it was empty until the full read finished, so
:shortcode:s in visible messages briefly showed as text on resume), and the palette no longer refetches on every reconnect attempt during backoff, only on status changes.Validation
Added test: the first read has no
since; a reconnect with nothing new sends asinceand keeps the palette as the identical list; a new member's set and a replaced set both arrive in the window and update it; a same-second replacement wins with a lower id and is ignored with a higher one. It fails without this change. Existing emoji picker tests pass; full mobile test suite andflutter analyzepass.On an iPhone 12 mini signed in to Block's Builderlab (instrumented profile build): after opening a channel, a resume after 60 s in the background downloaded the 1 MB of sets again (kind 30030, 123 events). With this change the same resume sent the read with a
sinceand got no events back, so the 1 MB was not downloaded again; the first read when opening the channel is unchanged (123 sets, 1 MB).Regressions
A set removed with a NIP-09 deletion (rather than replaced) stays in the palette until the app restarts, since a deletion isn't a newer set. Buzz clients edit a set by replacing it (desktop removes a shortcode by republishing the set), so that only affects other clients, and desktop's emoji directory keeps deleted sets the same way. A set written by a device whose clock is more than 30 minutes behind is missed until restart, the same bound the unread catch-up accepts.