You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(link): publish local opt-out catalog status once - #9024
When a Remote Link Child applies a local opt-out without a Home route document, record that the catalog is pending in the final publication. This removes an extra atomic receipt write, a lifecycle lock acquisition and a repeated Home-proof clear on that path.
Keep the materializer's write-ahead record and per-client outcome publication. The connected sync still publishes local outcomes before fetching models when a Home document is available.
Verification
Windows x64, Bun 1.4.4. The opt-out regression failed on the base with four writes and passed on this change with three. It exercises the normal sync entry point and also checks that the Home proof is absent and the opted-out file has been restored.
Six focused cases in tests/clients/route-intent-connected.test.ts passed with 25 assertions. They cover local-only opt-out, cached offline intent, deferred status, connection replacement during fetch, and connected sync applying and removing routes.
bun run typecheck checked 2,688 files. bun run structure:check, bun run privacy:scan, and git diff --check passed. Local testing covered the affected branches on a shared Windows host. The full repository suite was not run locally.
Checklist
Scope stays focused and avoids unrelated cleanup.
The integration architecture contract describes the final local-only receipt.
The existing guarded publication and Home-proof cleanup are preserved. The change adds no credential fields or diagnostic logging.
Summary by CodeRabbit
Bug Fixes
Local-only opt-outs are now recorded with their pending status in the final receipt when the Home integration is unavailable.
Documentation
Clarified how local opt-outs and their pending status are recorded, and how publication affects Home proof.
Reviewing files that changed from the base of the PR and between ed7e364 and b0b8aa3.
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
No actionable comments were generated in the recent review.
Walkthrough
For local-only connected route intents, the receipt is now marked catalogPending before its single persistence call. The test checks the receipt write sequence and resulting state. The integration responsibility entry documents local-only opt-out receipt handling.
Changes: Local-only receipt handling
Layer / File(s)
Summary
Persist local-only receipts once src/integrations/route-intent-connected.ts, tests/clients/route-intent-connected.test.ts, structure/clients/integrations.md
The implementation marks a local-only receipt pending before persistence and returns through the condition that also handles the all-clients-disabled case. The test expects receipt writes with catalogPending values [false, false, true] and checks the final receipt, absent Home receipt, and empty client file. The responsibility entry documents the pending receipt and Home-proof clearing.
This change removes a redundant receipt write when a local opt-out is applied without a Home route document. Behavior is otherwise preserved, and the regression test covers the new write sequence. No actionable merge risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "perf(link): publish local opt-out catalog status once" matches the main change. The PR stops an extra receipt write for local-only opt-outs by setting catalogPending before the single persi…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "perf(link): publish local opt-out catalog status once" matches the main change. The PR stops an extra receipt write for local-only opt-outs by setting catalogPending before the single persist, and the objectives describe the same aim of publishing the pending catalog status once. The title is short, specific, and uses a conventional commit prefix. It does not mention the Home-proof cleanup or the test changes, which is acceptable.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Fix failing CI checks
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Reviewing files that changed from the base of the PR and between e054f8e and ed7e364.
Files selected for processing: 1
structure/clients/integrations.md
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Checks on this head: 17 passed, 12 skipped, none pending or failing (Ubuntu PR CI; Windows/macOS are covered by the next dev batch gate).
Review threads: none unresolved.
Review: gpt-6.1-terra, two rounds, final verdict PASS.
Regression: tests/clients/route-intent-connected.test.ts passes on this head (25 pass) and the new receipt-sequence assertion fails with the source change reverted.
Checks on this head: 16 passed, 13 skipped, none pending or failing (Ubuntu PR CI; Windows/macOS are covered by the next dev batch gate).
Review threads: none unresolved.
Review: gpt-6.1-terra, two rounds, final verdict PASS.
Regression: tests/clients/route-intent-connected.test.ts passes (25 pass) and the new receipt-sequence assertion fails with the source change reverted.
This head merges current dev: the only conflict was the shared structure/clients/integrations.md row, also edited by fix(link): avoid writing an empty initial selection on disconnect #8989; both sentences are kept. On this tree: typecheck clean, structure:check passes, route-intent focused tests 36 pass / 0 fail.
Supersedes the earlier integration comment on ed7e364b0, which could not merge because of that conflict.
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
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
Verification
tests/clients/route-intent-connected.test.tspassed with 25 assertions. They cover local-only opt-out, cached offline intent, deferred status, connection replacement during fetch, and connected sync applying and removing routes.bun run typecheckchecked 2,688 files.bun run structure:check,bun run privacy:scan, andgit diff --checkpassed. Local testing covered the affected branches on a shared Windows host. The full repository suite was not run locally.Checklist
Summary by CodeRabbit