fix(slack): don't report handled auth failures on connect poll as exceptions#815
Draft
posthog[bot] wants to merge 1 commit into
Draft
fix(slack): don't report handled auth failures on connect poll as exceptions#815posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
…eptions The SlackConnectScreen background poll catches failures from fetchSlackConnected gracefully — it marks the project not-connected, shows the connect nudge, and stops polling — but it still called captureException for every failure, so an expected auth failure (an expired/invalid token 401, or a missing integration:read scope 403) surfaced as a new error tracking issue. Route fetchSlackConnected through handleApiError so it throws a clean ApiError with a statusCode (consistent with the sibling API helpers), and treat 401/403 on the poll as a benign analytics event rather than a captured exception. The graceful nudge fallback is unchanged. Also correct the program-scopes docstring, which predicted only a 403. Generated-By: PostHog Code Task-Id: d99c8488-726a-4e4d-8b3b-4c8e0dfb34fc
🧙 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's background poll reported a handled 401 auth failure to error tracking as a full exception, creating noise for the team.
fetchSlackConnecteddid a rawaxios.getand threw the rawAxiosError. TheSlackConnectScreenpoll already handles this gracefully (marks the project not-connected, shows the connect nudge, stops polling), but it still calledcaptureExceptionfor every failure — so an expected auth failure surfaced as a new error tracking issue. Nothing was broken for the user; the poll degrades cleanly. This is purely about error-tracking noise. The status we actually observed was a 401 (expired/invalid token), even though the missing-scope theory predicted a 403.Changes
fetchSlackConnectedthroughhandleApiError, so it throws a cleanApiErrorwith astatusCode— consistent with the other API helpers.401/403as an expected degradation: record a benignwizardCaptureanalytics event instead ofcaptureException. Any other error is still captured. The graceful nudge fallback is unchanged.program-scopes.tsdocstring, which predicted only a 403, to cover both the 401 and 403 auth paths.Test plan
pnpm build && pnpm test && pnpm fix— all 1211 tests pass, lint clean.Created with PostHog Code from an inbox report.