fix(slack): don't report transient poll 504s/timeouts to error tracking#835
Draft
posthog[bot] wants to merge 1 commit into
Draft
fix(slack): don't report transient poll 504s/timeouts to error tracking#835posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
The Slack-connect screen polls `/integrations/` to detect when the user finishes OAuth. Its `.catch` captured every failure as an exception, including transient PostHog gateway timeouts (504) — best-effort noise that the loop already recovers from. The poll now adds a short request timeout and classifies gateway (502/503/504), client-timeout, and no-response network errors as transient via a new `isTransientApiError` helper: on those it keeps polling quietly so the next tick can recover, and only genuinely unexpected errors are captured once (and stop the loop) as before. Generated-By: PostHog Code Task-Id: b1b3be80-856c-4c02-99da-2f9ce7f665c6
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Slack-connect screen polls
/api/projects/:id/integrations/to detect when a user finishes the Slack OAuth flow in their browser. The poll's.catchdeliberately reports every failure to error tracking (step: 'slack_connected_check') — but that includes transient PostHog gateway timeouts (504). The loop already degrades gracefully on failure (it stops polling and falls back to the connect nudge), so a server-side blip surfaced as an exception is error-tracking noise that hurts the team, not users.Changes
isTransientApiErrorhelper insrc/lib/api.tsthat recognizes gateway statuses (502/503/504), client request timeouts (ECONNABORTED/ETIMEDOUT), and no-response network drops (ERR_NETWORK).fetchSlackConnecteda short (5s) request timeout so a hung tick aborts and lets the next tick retry instead of wedging the loop..catch, transient errors now reschedule the next poll tick quietly instead of callingcaptureException. Genuinely unexpected errors are still captured once and stop the loop, exactly as before.Test plan
src/lib/__tests__/api-transient-error.test.tscovers the transient/non-transient classification (gateway statuses, timeouts, network drops, real HTTP errors, non-axios values).pnpm build && pnpm test && pnpm lint— build passes, tests pass, lint clean on changed files.LLM context
Authored by PostHog Code (Claude) from an inbox report about transient 504s on the Slack connectivity poll being reported to error tracking.
Created with PostHog Code from an inbox report.