Skip to content

fix(sync): retry transient 5xx errors in fetchWithRetry - #246

Merged
sinduri-g merged 1 commit into
mainfrom
fix/retry-5xx-discourse-fetch
Sep 8, 2026
Merged

fix(sync): retry transient 5xx errors in fetchWithRetry#246
sinduri-g merged 1 commit into
mainfrom
fix/retry-5xx-discourse-fetch

Conversation

@sinduri-g

@sinduri-g sinduri-g commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #245.

  • Extend fetchWithRetry to retry HTTP 500, 502, 503, 504 with exponential backoff (1s, 2s, 4s, capped at 30s)
  • Previously only 429 (rate-limit) was retried; a momentary Discourse 500 or 502 counted as a hard failure and exceeded MAX_TOLERATED_FAILURES=1
  • Update pagination tests in refresh-discussions to use fake timers so 5xx chunk failures exhaust retries without real-time waits
  • Add five new fetchWithRetry unit tests covering the 5xx retry path

Type of change

  • feat new feature
  • fix bug fix
  • refactor no behavior change
  • docs / chore / config / perf / style / security

Manual checks

  • Screen reader tested (UI changes only)
  • New routes added to e2e/a11y.spec.ts, e2e/smoke.spec.ts, sitemap.xml.ts, and README (routes only; sitemap is auto-generated from getStaticPaths, so only static pages need manual entries)
  • UI verified at 375px, 768px, and 1280px against the production build (npm run build && npm run preview) (UI changes only)
  • Re-read every changed file; checked all call sites of any modified exports (all changes)
  • Per-level discussion JSON exists with correct discussionUrl (adventure/level changes only)

Fixes #245.

- Extend fetchWithRetry to retry HTTP 500, 502, 503, 504 with
  exponential backoff (1s, 2s, 4s, capped at 30s)
- Previously only 429 (rate-limit) was retried; a momentary Discourse
  500 or 502 counted as a hard failure and exceeded MAX_TOLERATED_FAILURES=1
- Update pagination tests in refresh-discussions to use fake timers so
  5xx chunk failures exhaust retries without real-time waits
- Add five new fetchWithRetry unit tests covering the 5xx retry path

Signed-off-by: Sinduri Guntupalli <sinduri.guntupalli@dynatrace.com>
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-08 06:42 UTC

@sinduri-g
sinduri-g merged commit 67cff25 into main Sep 8, 2026
8 checks passed
@sinduri-g
sinduri-g deleted the fix/retry-5xx-discourse-fetch branch September 8, 2026 06:42
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.

Refresh community data: run failed, data not updated

1 participant