Skip to content

Fix exhausted mobile reseed retries - #876

Merged
arul28 merged 2 commits into
mainfrom
ade-128-sync-bound-ios-cr-sqlite-replica-catch-up-with-a-too-far-behind-reseed-post-869
Jul 23, 2026
Merged

Fix exhausted mobile reseed retries#876
arul28 merged 2 commits into
mainfrom
ade-128-sync-bound-ios-cr-sqlite-replica-catch-up-with-a-too-far-behind-reseed-post-869

Conversation

@arul28

@arul28arul28 commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Follow-up to #875.

Summary

  • Re-enable bounded mobile reseeding when an in-flight catchup batch exhausts its ACK retry budget.
  • Preserve the peer cursor and existing recovery backoff so the next eligible send is a fresh compact reseed, not incremental replay.
  • Add a regression test covering six timed-out sends, the recovery delay, and a new catchup batch from the old cursor.

Validation

  • npx vitest run src/services/sync/syncHostService.test.ts
  • npx vitest run src/services/sync/syncHostService.test.ts -t "reseed"
  • npm run typecheck

Greptile Summary

Re-enables bounded mobile reseeding after exhausted ACK retries.

  • Preserves the peer cursor and recovery backoff before launching a fresh compact catchup batch.
  • Limits fresh compact reseed launches to one peer per poll.
  • Accelerates sparse reseed-cache construction through bounded empty-window scans.
  • Refreshes stale oversized caches and adds regression coverage for retry recovery, admission, sparse histories, and cache rebuilding.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failures remain.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the Vitest test for src/services/sync/syncHostService.test.ts with the -t "retries an abandoned far-behind replica reseed" filter, and the run finished with exit code 0, reporting 1 test file passed and 1 selected test passed in 2.65s.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

FilenameOverview
apps/ade-cli/src/services/sync/syncHostService.tsRestores compact reseed eligibility after catchup abandonment, refreshes stale caches, bounds sparse-cache advancement, and limits fresh launches per poll.
apps/ade-cli/src/services/sync/mobileReplicaReseed.tsTracks whether a cache-build step crossed an empty version window so sparse histories can advance in bounded bursts.
apps/ade-cli/src/services/sync/syncHostService.test.tsAdds coverage for exhausted retry recovery, per-poll reseed admission, sparse version gaps, and rebuilding oversized caches.

Sequence Diagram

sequenceDiagram
participant Phone as Mobile replica
participant Host as Sync host
participant Cache as Reseed cache
Phone->>Host: Connect with stale cursor
Host->>Cache: Build bounded compact reseed
Cache-->>Host: Ready catchup batch
Host->>Phone: Send catchup batch
loop ACK retry budget
Host->>Phone: Retry same batch
end
Host->>Host: Abandon batch and retain old cursor
Host->>Host: Wait for recovery backoff
Host->>Cache: Reuse or rebuild reseed
Host->>Phone: Send fresh catchup batch
Loading

Reviews (2): Last reviewed commit: "perf(sync): bound compact reseed work" | Re-trigger Greptile

@vercel

vercelBot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
adeIgnoredIgnoredPreviewJul 22, 2026 11:43pm

@linear-code

Copy link
Copy Markdown

ADE-128

@coderabbitai

coderabbitaiBot commented Jul 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@arul28, you've reached your PR review limit, so we couldn't start this review.

Next review available in:24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 929b0c28-b4f4-4857-92fe-15e756e23d99

📥 Commits

Reviewing files that changed from the base of the PR and between fd03f63 and 8afa557.

📒 Files selected for processing (3)
  • apps/ade-cli/src/services/sync/mobileReplicaReseed.ts
  • apps/ade-cli/src/services/sync/syncHostService.test.ts
  • apps/ade-cli/src/services/sync/syncHostService.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade-128-sync-bound-ios-cr-sqlite-replica-catch-up-with-a-too-far-behind-reseed-post-869

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.

@arul28
arul28 merged commit ae5479a into mainJul 23, 2026
5 checks passed
@arul28
arul28 deleted the ade-128-sync-bound-ios-cr-sqlite-replica-catch-up-with-a-too-far-behind-reseed-post-869 branch July 23, 2026 02:49
Sign up for freeto 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

@arul28