Skip to content

fix(client): retry family sync target when covering plain sync fails (#1053) - #1054

Merged
dezren39 merged 1 commit into
mainfrom
queue/4203-1053-family-cover-fail
Oct 31, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/4203-1053-family-cover-fail

Conversation

@dezren39

@dezren39 dezren39 commented Oct 31, 2026 •

Copy link
Copy Markdown

Fixes #1053

Problem

The #1051 unread guard drops the family sync's target snapshot when a concurrent plain sync's covering read is merely in flight. If that covering read then fails, nobody publishes the target — and the family sync still completed session.family:<id>, so later family syncs no-oped and the pre-walk snapshot stuck indefinitely.

Fix

Sibling audit (acceptance criterion)

  • children.filter(unread) at the family publish and in syncDescendants (formerly data.ts:589): same loss was possible — a listed child dropped for a pending cover whose read then failed would stick at its older store snapshot under a completed family key. Fixed the same way, above.
  • Ancestors: filter is existence-only (!store.session.info[ancestor.id]), so a skipped ancestor was actually published by someone — nothing can be lost there. No change.

Tests

Queue task 4203.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Family synchronization now retries when an overlapping read fails, rather than treating the sync as complete. This helps ensure a later sync fetches and displays the latest available data instead of leaving an older cached snapshot in place.

The #1051 unread guard drops the family sync target (and direct/descendant children) when a covering plain sync is merely in flight. If that read then fails, nobody publishes the dropped snapshot, yet the family key completed, so later family syncs no-oped and the stale snapshot stuck (#1053).

Track drops that are only due to a pending covering read (pendingCover: not unread, but the covering session key is still pending, not settled) at all three unread publish sites - the family target/direct children and syncDescendants listings - and treat such a walk like a truncated one: invalidate the family key so the next family sync re-reads the dropped session. A covering read that has already settled has published, so #1051 behaviour is preserved exactly.

Sibling audit: ancestors use an existence-only filter, so a skipped ancestor was actually published by someone and cannot be lost this way; children use unread, so they are fixed the same way via the syncDescendants droppedPending result and the direct-children check at the family publish.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T04:51:12.937821Z 203e208 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9a3f4e4b-c3fd-40e8-b2c5-ad452ba7083f
Commits

Reviewing files that changed from the base of the PR and between 79ebc5b and 203e208.

Files selected for processing: 2
  • packages/client/src/solid/data.ts
  • packages/client/test/solid-data.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Family sync now tracks snapshots omitted while covering reads are pending. It invalidates its key when reads or listings are incomplete, or when a snapshot is omitted. A regression test verifies that a later family sync re-reads the target.

Changes: Family sync retry

Layer / File(s) Summary
Track pending covering reads
packages/client/src/solid/data.ts
pendingCover identifies sessions with pending reads. syncDescendants returns listing completeness and whether it dropped snapshots covered by pending reads.
Invalidate family sync when snapshots are dropped
packages/client/src/solid/data.ts, packages/client/test/solid-data.test.ts
Family sync checks its target and direct children, then invalidates its key when reads or listings are incomplete or snapshots were dropped. A regression test verifies that a later family sync re-reads the target.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • #1053 — The changes invalidate the family key when a pending covering read causes a snapshot to be dropped, allowing a later family sync to retry.

Possibly related PRs

  • developing-today/opencode#843 — This PR changes the family-sync traversal and adds retry behavior for snapshots omitted during that traversal.
  • developing-today/opencode#64 — This PR addresses a failure race in the family-sync implementation introduced by the recursive family discovery work.
  • developing-today/opencode#60 — This PR fixes a failure path in the shared family-sync implementation used by nested-ask data loading.

Suggested reviewers: kitlangton

Merge Risk: Minimal · up to 203e2

Family sync can retry snapshots dropped during pending reads. No merge-blocking risk was identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary fix: retrying the family sync target when a covering plain sync fails.
Description check Passed The description is mostly complete. It includes the issue, problem, fix, affected sibling paths, regression test, verification command, and test results. It does not select a change type or include th…
Linked Issues check Passed The PR addresses all coding criteria for active issue #1053. pendingCover distinguishes an in-flight covering session:<id> read from a settled read. Family publish and syncDescendants report pen…
Out of Scope Changes check Passed The reported changes are limited to the linked issue scope. They update family-sync drop detection and retry invalidation in packages/client/src/solid/data.ts, and add the corresponding regression t…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Description check

Explanation

The description is mostly complete. It includes the issue, problem, fix, affected sibling paths, regression test, verification command, and test results. It does not select a change type or include the template checklist and screenshots section, but those omissions do not prevent understanding the change.

Full details: Linked Issues check

Explanation

The PR addresses all coding criteria for active issue #1053. pendingCover distinguishes an in-flight covering session:&lt;id&gt; read from a settled read. Family publish and syncDescendants report pending-cover drops and invalidate session.family:&lt;id&gt;, so a later family sync retries the target or child. The PR adds the requested regression test in packages/client/test/solid-data.test.ts for a failed concurrent plain sync. The reported test run passed 43 tests, including the #631, #1038, #1039, and #1051 family-sync tests. The existing settled-read guard preserves the #1051 success behavior.

Full details: Out of Scope Changes check

Explanation

The reported changes are limited to the linked issue scope. They update family-sync drop detection and retry invalidation in packages/client/src/solid/data.ts, and add the corresponding regression test in packages/client/test/solid-data.test.ts. These implementation and test changes directly support #1053. No unrelated change is identified.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • 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.

Share

@dezren39
dezren39 merged commit c9d1943 into main Oct 31, 2026
1 check passed
@dezren39
dezren39 deleted the queue/4203-1053-family-cover-fail branch November 2, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant