Skip to content

fix: retire disposed live ownership - #242

Open
patrickleet wants to merge 1 commit into
fix/live-snapshot-graphsfrom
fix/live-ownership-handoff
Open

fix: retire disposed live ownership#242
patrickleet wants to merge 1 commit into
fix/live-snapshot-graphsfrom
fix/live-ownership-handoff

Conversation

@patrickleet

@patrickleet patrickleet commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Retire local live-query ownership when the last watch for a stream is disposed,
then let a later snapshot stream take over shared nested indexes. The runtime
keeps the retirement boundary in operation metadata so callbacks from a stream
that started before disposal remain fenced, while a stream started afterward
can populate the current page immediately.

User benefit

Navigation between pages that share nested relationship data no longer leaves
the new page stuck behind a disposed page's membership. The replacement page
can render its authorized snapshot without a refresh or polling workaround.

Scope and ordering

The boundary is scoped to one replica's live-operation lifecycle. It is local
runtime ownership/order metadata, not a server clock, projection position, or
claim that the server stopped producing events. Reopening an operation clears
the retired marker before synchronous transport callbacks arrive. Hydration
preserves retired boundaries and does not replace an already active receiver's
ownership.

Verification

  • npm run build
  • npm run check
  • npm test — 384 passed, 0 failed
  • Targeted ownership regressions — 7 passed, 0 failed
  • git diff --check

Before the fix, the regression test snapshot live takes over a nested graph from a disposed page subscription failed with 0 !== 1: the disposed-page
owner continued to block the later snapshot stream.

User-facing copy

No user-facing copy was added.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 3de4ac7b-a42d-42bb-8302-18412bbccf0b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant