Skip to content

feat(seer-explorer): Add polling backoff for 5xx errors#115538

Merged
aliu39 merged 8 commits into
masterfrom
aliu/err-backoff
May 14, 2026
Merged

feat(seer-explorer): Add polling backoff for 5xx errors#115538
aliu39 merged 8 commits into
masterfrom
aliu/err-backoff

Conversation

@aliu39
Copy link
Copy Markdown
Member

@aliu39 aliu39 commented May 14, 2026

Summary

  • On 5xx API errors, poll with backoff at 2500ms intervals instead of stopping entirely
  • Non-5xx errors (4xx, etc.) still stop polling immediately
  • After ~60s of consecutive 5xx errors, stop polling
  • getPollingState now takes isError, errorStatusCode, and errorPollCount to determine polling behavior
  • isPolling returns true for both normal polling and backoff polling

Test plan

  • Updated existing test to verify 500 errors result in isPolling: true
  • Added test for 404 errors to verify isPolling: false

Instead of stopping polling on all errors, 5xx errors now trigger
polling-with-backoff at a slower 2500ms interval. Non-5xx errors
still stop polling entirely.
@aliu39 aliu39 requested a review from a team as a code owner May 14, 2026 01:07
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 14, 2026
Comment thread static/app/views/seerExplorer/hooks/useSeerExplorerPolling.tsx Outdated
…ngState

errorStatusCode being null doesn't reliably indicate no error — pass
isError separately so the error check is correct regardless of whether
a status code is available.
Comment thread static/app/views/seerExplorer/hooks/useSeerExplorerPolling.tsx
@aliu39 aliu39 changed the title fix(seer-explorer): Add polling backoff for 5xx errors feat(seer-explorer): Add polling backoff for 5xx errors May 14, 2026
Stop polling after ~60s of consecutive 5xx errors by tracking an
error poll counter. The counter increments on each backoff poll and
resets when polling returns to normal.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.51%

Comment thread static/app/views/seerExplorer/hooks/useSeerExplorerPolling.tsx
Comment thread static/app/views/seerExplorer/hooks/useSeerExplorerPolling.tsx Outdated
@aliu39 aliu39 marked this pull request as draft May 14, 2026 02:35
- Only reset errorPollCount when transitioning back to normal polling,
  not on all non-backoff states. Fixes stuck isPolling=true after
  backoff exhaustion.
- Reset errorPollCount when runId changes so new sessions start fresh.
@aliu39 aliu39 marked this pull request as ready for review May 14, 2026 04:49
Comment thread static/app/views/seerExplorer/hooks/useSeerExplorerPolling.tsx
@aliu39
Copy link
Copy Markdown
Member Author

aliu39 commented May 14, 2026

@sentry review
cursor review

@aliu39
Copy link
Copy Markdown
Member Author

aliu39 commented May 14, 2026

cursor review

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5fbd0c2. Configure here.

@aliu39 aliu39 merged commit 01b2764 into master May 14, 2026
74 checks passed
@aliu39 aliu39 deleted the aliu/err-backoff branch May 14, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants