Skip to content

feat: add retry backoff for connection errors in retryOperation#4

Closed
leshniak wants to merge 16 commits intomainfrom
feat/retry-backoff-connection-errors
Closed

feat: add retry backoff for connection errors in retryOperation#4
leshniak wants to merge 16 commits intomainfrom
feat/retry-backoff-connection-errors

Conversation

@leshniak
Copy link
Copy Markdown

@leshniak leshniak commented Apr 17, 2026

Summary

Linked Issues

Changes

  • lib/OnyxUtils.ts: CONNECTION_ERRORS constants, wait()/getRetryDelay() helpers, backoff wired into non-capacity error branch of retryOperation
  • tests/unit/onyxUtilsTest.ts: Updated 2 existing tests for fake timers, added 3 new tests (exponential progression, connection error logging, capacity errors remain immediate)

Test plan

  • npm run typecheck passes
  • npm run lint passes
  • npm test — 437/437 tests pass
  • Verify backoff delays increase exponentially (test: should apply exponential backoff delay for non-capacity errors)
  • Verify connection errors log with backoff info (test: should log connection error with backoff delay info)
  • Verify capacity errors are NOT delayed (test: should NOT apply backoff delay for capacity errors)

🤖 Generated with Claude Code

MrMuzyk and others added 16 commits April 15, 2026 10:37
…mprove-logging

feat: Improve retryOperation and reportStorageQuota logging to include original error
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Errors like lost IDB connections, closing databases, and backing store
failures now wait with exponential backoff (100ms * 2^attempt +/- 25%
jitter) before retrying, giving the DB connection time to recover.

Capacity errors (QuotaExceeded, disk full) keep immediate retry with
eviction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Existing retry tests now use fake timers to handle backoff delays.
New tests verify: exponential delay progression, connection error
logging, and capacity errors remaining immediate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ba2d3b04-e5ac-4755-a32b-02f532e9fbb6

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/retry-backoff-connection-errors

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 and usage tips.

@leshniak leshniak closed this Apr 17, 2026
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.

5 participants