Repository navigation
Fix session snapshot/catalogue revision races - #36
Merged
Merged
Conversation
ElSargo
commented
Sep 16, 2026
ElSargo
left a comment
Owner
Author
There was a problem hiding this comment.
Brood QA (static) — code looks good
Verdict: COMMENT LGTM for remit of #30 (session snapshot / catalogue revision races). Not a formal APPROVE (reviewer is ElSargo).
Evidence
- Switcher tracks
backend_session_revisionsand rejectssnapshot.revision < lastinapply_snapshot; empty unstamped snapshot without a baseline preserves live rows. - Catalogue path rejects stamped older revisions and unstamped catalogues when a live revision exists; empty catalogue bootstrap preserve limited to current backend with
last.is_none(). - Client stamps
BackendCatalogueEntry.snapshot_revisionfromSessionSnapshot.revisionand skips older map inserts / actor broadcasts when both revisions are non-zero. - Protocol field is
#[serde(default)]with a wire-compat test; regression tests cover stale non-empty catalogue and late older empty snapshot.
Residuals (acknowledged in PR)
- Pane/route/renderer apply from delayed
BackendSnapshotstill not revision-gated — only catalogue / actor broadcast path.
CI
FAILED — GHA Nix ENOSPC (No space left on device while extracting rust-std wasm targets). Not treated as a code blocker.
Stacking
Overlaps plugins/session-switcher/src/lib.rs + docs/frictions/ui-concurrency.md with #37 / #40 (and friction doc with #43 / #45). Prefer merge order #36 → #37 → #40 then reconcile friction remits; expect conflicts on those two files.
Desktop verify: not run (no clear smoke without full client + multi-backend reconnect).
This was referenced Sep 16, 2026
Gate switcher apply_snapshot / apply_backend_sessions on per-backend snapshot revisions, stamp BackendCatalogueEntry.snapshot_revision from the client map, and reject older BackendSnapshot inserts so delayed non-empty catalogues and late empty snapshots cannot regress live rows. Fixes #30
ElSargo
force-pushed
the
fix/session-catalogue-revision-gate
branch
from
September 16, 2026 21:58
91ed730 to
a9a0dcc
Compare
Owner
Author
|
Merged to main as 6232495 after rebase conflict resolution. |
ElSargo
added a commit
that referenced
this pull request
Sep 16, 2026
stale_catalogue_after_create needed BackendCatalogueEntry::snapshot_revision introduced by #36.
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.
Summary
SessionSnapshotapplies (including late empty snapshots after catalogue-installed rows).snapshot_revisiononBackendCatalogueEntry; reject stale/unstamped catalogues that would regress a newer live snapshot.SessionSnapshot.revisionand skip olderBackendSnapshotmap inserts / actor broadcasts.docs/frictions/ui-concurrency.md.Fixes #30
Residual risk
Pane/route/renderer state from a delayed
BackendSnapshotevent may still be applied before the session-map revision gate; only the session catalogue / actor broadcast path is revision-gated in this PR.Test plan
cargo test -p brood-protocol --lib backend_cataloguecd plugins/session-switcher && RUSTFLAGS='-C linker=cc' cargo test --lib— 46 passed