Skip to content

fix(client): retry truncated ancestor walks instead of caching them - #1048

Merged
dezren39 merged 1 commit into
mainfrom
queue/4118-1039-ancestor-retry
Oct 31, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/4118-1039-ancestor-retry

Conversation

@dezren39

@dezren39 dezren39 commented Oct 31, 2026 •

Copy link
Copy Markdown

Closes #1039.

Problem

PR #843's family sync walks missing ancestors by ID, best effort: when an ancestor session.get fails (the .catch(() => undefined)), the walk breaks and the sync still completes, caching session.family:<id> as complete. Later family syncs — including reopening the same session — never retry the missing ancestor until an unrelated invalidation. resolveRoot then keeps grouping under the furthest-known ancestor: the #631 wrong-root symptom, with no error surfaced. The descendant walk already invalidates on a skipped branch; the ancestor walk had no mirror rule.

Fix

  • Track ancestorsComplete: set false only when a parent GET fails or returns a mismatched ID (walk stopped early). Genuine termination (no parentID, seen-set cycle guard, or walking through cached info) still counts as complete — no invalidation loop.
  • After publishing, invalidate session.family:<id> when the ancestor walk truncated OR the descendant walk was incomplete. syncDescendants still always runs for its publish side effect (no short-circuit).
  • Regression test retries the ancestor walk on the next sync after a parent read failed: first family sync with a 500 on the root GET groups tentatively without root info; second sync re-GETs the root (asserted: 2 root GETs), resolves the true root, and completes the family.

Acceptance

Verification

  • bun test test/solid-data.test.ts (packages/client): 40/40 pass with fix; new test fails on unpatched code (2nd root GET never happens) — true regression coverage.
  • bun typecheck (packages/client): clean.
  • Diff: 2 files, +61/-2 (fix + test only).

Notes

  • Branch uses the queue worker namespace queue/4118-1039-ancestor-retry per the repo-queue runbook for traceability (repo AGENTS.md prefers slashless short names; runbook governs here).
  • Task 4118 (openchamber-scheduled-lane).

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

@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: 7e6ea9c1-242d-435e-b9ed-d59066f0f1e1
Commits

Reviewing files that changed from the base of the PR and between a1a1e34 and 8677c67.

Files selected for processing: 2
  • packages/client/src/solid/data.ts
  • packages/client/test/solid-data.test.ts
  • 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

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

@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-31T02:11:53.751556Z 8677c67 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.

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.

fix(client): an ancestor walk that fails partway is cached as a complete family sync, so the missing ancestor is never retried

1 participant