Skip to content

fix: extend cryptify retry budget to cover restart window#186

Closed
dobby-coder[bot] wants to merge 1 commit into
mainfrom
fix/issue-181-retry-policy
Closed

fix: extend cryptify retry budget to cover restart window#186
dobby-coder[bot] wants to merge 1 commit into
mainfrom
fix/issue-181-retry-policy

Conversation

@dobby-coder

@dobby-coder dobby-coder Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

The default pg-js retry policy (5 attempts, 500ms initial, multiplier 2) exhausts the total wait budget in ~7.5s. That's shorter than a typical cryptify service restart, so a brief backend outage surfaces as a hard failure for the user.

This bumps the retry config on the shared `PostGuard` instance:

  • `maxAttempts: 8` (was default 5)
  • `initialDelayMs: 1000` (was default 500)

With the existing multiplier (2) and 30s cap, total cumulative wait is now ~91s (1s + 2s + 4s + 8s + 16s + 30s + 30s) — enough to ride out a restart while still failing fast for genuinely unreachable backends.

Closes #181

Test plan

  • `npm run build` passes
  • `npx svelte-check --threshold warning` clean
  • Reviewer: trigger a cryptify restart mid-upload/download and verify the SDK retries through it without showing a terminal error

Reviewer quickstart:
```
git fetch origin && git checkout fix/issue-181-retry-policy && npm install --legacy-peer-deps && npm run dev
```

The default pg-js retry policy (5 attempts, 500ms initial delay,
multiplier 2) exhausts in ~7.5s of total wait time. That's shorter
than a typical cryptify service restart, so users see a hard failure
during what should be a recoverable outage.

Bump maxAttempts to 8 and initialDelayMs to 1000ms so the retry
budget covers ~90s of total wait — long enough to ride out a
restart while still failing fast for genuinely down backends.

Closes #181
@dobby-coder dobby-coder Bot requested a review from rubenhensen May 9, 2026 13:37
@dobby-coder dobby-coder Bot marked this pull request as ready for review May 9, 2026 13:40
@dobby-coder

dobby-coder Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #202 (consolidation per encryption4all/dobby#53). Closing to keep the queue tidy.

@dobby-coder dobby-coder Bot closed this May 9, 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.

retry policy on cryptify crash is too fast

0 participants