fix!: keep authorized snapshot live queries subscribed - #239
Open
patrickleet wants to merge 1 commit into
Open
Conversation
Separate snapshot delivery from resumable projection evidence. Preserve authorization, source fencing, and SSR hydration invariants. BREAKING CHANGE: live.mode replaces live.supported; upgrade server and client together. Implements [[tasks/distributed-private-live-snapshots]]
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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 row-filtered
@livequery should keep updating without revealing activity from rows the viewer cannot read. Previously the server correctly withheld partition-wide resume cursors, but reportedsupported: false; the client treated that as unavailable live delivery, closed the stream, and performed one HTTP refresh. Later authorized changes no longer reached the UI.What changes
Live delivery now distinguishes authorized replacement snapshots from resumable projection streams:
{ "mode": "snapshot", "reset": true, "cursors": [] }{ "mode": "resumable", "reset": false, "cursors": [{ "projection": "items", "position": "7", "token": "opaque" }] }Applications keep writing ordinary queries:
Read permissions still decide which rows are visible. Snapshot delivery carries no comparable index vector or projection observations, cannot confirm optimistic commands, and never uses partition-wide resume tokens. Visible updates and removals continue through the subscription; denied-row changes produce no activity frame.
The replica preserves SSR hydration without an extra first fetch, fences older overlapping HTTP responses and disposed/auth-invalidated subscriptions, and restarts a snapshot stream after an explicitly newer HTTP refresh. Existing resumable replay and cross-operation causal fences remain intact. The gateway does not use cursorless frames as shared replay-handoff evidence.
Breaking v5 protocol change
live.modereplaceslive.supported. Upgrade server and client runtime together. Old/unknown modes fail closed; no compatibility branch or application polling workaround.Validation
No user-facing UI copy is added. README and protocol documentation explain the new wire contract.