Repository navigation
Conversation
Co-authored-by: Zot <c3aebd34f908628cf72f7f0537da6ec46cec1eb63888805ce915222ed751f17b@buzz.block.builderlab.xyz> Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
Co-authored-by: Zot <c3aebd34f908628cf72f7f0537da6ec46cec1eb63888805ce915222ed751f17b@buzz.block.builderlab.xyz> Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
Co-authored-by: Zot <c3aebd34f908628cf72f7f0537da6ec46cec1eb63888805ce915222ed751f17b@buzz.block.builderlab.xyz> Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
Co-authored-by: Zot <c3aebd34f908628cf72f7f0537da6ec46cec1eb63888805ce915222ed751f17b@buzz.block.builderlab.xyz> Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
Co-authored-by: Zot <c3aebd34f908628cf72f7f0537da6ec46cec1eb63888805ce915222ed751f17b@buzz.block.builderlab.xyz> Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
Co-authored-by: Zot <c3aebd34f908628cf72f7f0537da6ec46cec1eb63888805ce915222ed751f17b@buzz.block.builderlab.xyz> Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
Co-authored-by: Zot <c3aebd34f908628cf72f7f0537da6ec46cec1eb63888805ce915222ed751f17b@buzz.block.builderlab.xyz> Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
Co-authored-by: Zot <c3aebd34f908628cf72f7f0537da6ec46cec1eb63888805ce915222ed751f17b@buzz.block.builderlab.xyz> Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
Co-authored-by: Zot <c3aebd34f908628cf72f7f0537da6ec46cec1eb63888805ce915222ed751f17b@buzz.block.builderlab.xyz> Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
Co-authored-by: Zot <c3aebd34f908628cf72f7f0537da6ec46cec1eb63888805ce915222ed751f17b@buzz.block.builderlab.xyz> Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
Co-authored-by: Zot <c3aebd34f908628cf72f7f0537da6ec46cec1eb63888805ce915222ed751f17b@buzz.block.builderlab.xyz> Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A change to one channel can rewrite the complete startup roster in IndexedDB. Pruning then reads large roster and profile values back into the renderer.
What
Coalesce routine discovery changes into at most one full save every 30 seconds during a steady burst. Keep first saves, signed grants, first channel names, and revocations on their existing prompt path. Prune from keys and byte counts. Skip duplicate sidebar saves after a successful write.
How
Keep the roster and sidebar settings in the existing version 2 row, so older builds can restore and clear the same records. Keep merge and prune inside the storage transaction. Channel restore records the roster version during startup reads. Manual Reload records it too and waits for live discovery before showing channels. A successful save advances the recorded version. An aborted write can retry against that version. Only the current conflicting attempt can record a peer replacement. A signed change that arrives during a pending write stays eligible after that replacement. Once the cooldown ends, a repeat can save the change if the replacement is still current. If a peer emptied the cache, guarded repeats stop. A fresh signed confirmation can still update a queued save. A skipped or evicted preference write remains retryable.
Risk
The last saved snapshot serves offline startup during the cooldown. Signed membership removal saves immediately. Live confirmation of a cached system channel bypasses the cooldown.
Testing
A replay of 20 updates over 10 seconds used 3,752 signed events in a 3.89 MB roster. Chromium and WebKit each went from 20 full writes and 273.4 MB transferred to one full write and 7,782,224 bytes transferred. Pruning read 788 bytes of metadata and zero roster payloads. The byte count uses UTF-8 JSON sizes of IndexedDB values.
The real IndexedDB case replaces the prior mocked mirror-eviction assertion. It also runs the version 2 clear against two populated scopes, inspects raw payloads before any new write, and confirms the other scope remains available. The same case reproduced surviving roster rows on the earlier sharded implementation.
Chromium and WebKit passed 28 startup and persistence cases at
55b89614. The expanded regression failed in both engines on48845862and passed on55b89614. It saves a signed change received during a pending write after a peer replacement. It also keeps the cache empty after a clear, replacement, and second clear.On
fac4618a, both engines reproduced a Reload save that could not retry after an abort and a fresh change that stayed unsaved after a conflict. With the fix, the Reload retry and the save after cooldown both passed. The tests held two guarded writes in IndexedDB and verified that a peer replacement and a later clear survived.Both engines also retried an aborted revocation while the roster stayed unchanged. They kept the fixes for an earlier peer clear that was undone and three redundant reads after a peer replacement, both reproduced on
9828d5b1. An isolated WebKit run restored the saved conversation and sidebar group before the handshake.After merging
mainat6d4f1107, commit416b0ff5passed all 28 Chromium and WebKit cases, including cached startup and cross-tab cache clears. The separate WebKit startup run passed. The replay still used one roster write and 7,782,224 bytes across 20 updates. Pruning read 788 metadata bytes and zero roster payloads. Pre-push passed TypeScript, 12,702 related tests, and the design checks. Human startup confirmation is pending.Generated with Codex