Back off Builder sync recovery - #1181
Conversation
04f7182 to
8fb4cb1
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughBuilder project sync recovery now uses bounded exponential backoff for failed snapshot fetches. The retry delay starts at 500 ms, doubles after failures, caps at 30 seconds, and resets after successful recovery. Tests verify retry timing and errors. ChangesStream recovery backoff
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change limits repeated Builder recovery requests while preserving immediate recovery and normal synchronization behavior; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tanstack-com | 8fb4cb1 | Commit Preview URL Branch Preview URL |
Aug 26 2026, 03:35 PM |
Evidence
When a terminal Builder EventSource cannot recover its authoritative snapshot, the client retries every 500 ms forever. That is 120 sync requests per minute from one tab. The user and project stream limiter allows 180 requests per minute, so two open tabs can make 240 requests per minute during an outage and keep recovery requests rate limited.
The durable outbox already uses exponential retry delays for the same class of transient failures.
Change
Back off failed stream recovery snapshots from 500 ms to 30 seconds, and reset the delay after a successful authoritative snapshot. Recovery still starts immediately and keeps the existing abort behavior.
Impact
This prevents disconnected Builder tabs from creating a retry storm or prolonging a 429 lockout while keeping the first recovery attempt fast.
Validation
Risk
Low. The change is isolated to repeated snapshot failures after a terminal stream error. Successful recovery and ordinary live sync behavior are unchanged.
Summary by CodeRabbit