fix(frontend): suppress posthog-js internal request-timeout abort - #3332
posthog-eu[bot] wants to merge 1 commit into
Conversation
posthog-js aborts its own outgoing request on an internal timeout, and exception autocapture then files that abort as a page error even though no application code raises it. Add an anchored pattern to the transient-network suppression list so the SDK's own timeout message stops landing as a high-severity error tracking issue, while a genuine app-side abort with a different message still reports. Generated-By: PostHog Desktop Task-Id: 5fcd0ad2-0039-4d3f-8832-9d962b799d23
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
|



Summary
AbortError: PostHog request timed out after 3000msis telemetry noise: posthog-js aborts its own outgoing request on an internal timeout, and exception autocapture then files that abort as a page error, even though no application code raises it. No user-facing flow breaks.buildOtlpLogRecord→_processInitTaskQueue), so the reverse proxy atpsthg.capgo.app, an offline tab, or a page unload is enough to trip it.TRANSIENT_NETWORK_ERROR_PATTERNSinsrc/services/staleAssetErrors.ts, whichbefore_sendinsrc/services/posthog.tsalready uses to drop known noise.The pattern is kept tight so a genuine app-side abort with a different message still reports:
/^(?:.*: )?PostHog request timed out after \d+ms$/i\d+mscovers both the 3000ms message and the earlier 10000ms variant.(?:.*: )?prefix matches the wording either bare or with theAbortError:type prefix, consistent with the other transient-network patterns.Test plan
bun run vitest run tests/stale-asset-errors.unit.test.ts— 14 pass, including new cases for the timeout message, the 10000ms variant, theAbortError:prefix, and a negative case (PostHog request timed out after a while) that must still report.npx eslint src/services/staleAssetErrors.ts tests/stale-asset-errors.unit.test.ts— clean.Screenshots
Not applicable — suppression logic only, no UI change.
Checklist
bun run lint:backend && bun run lint.accordingly.
my tests
Created with PostHog Desktop from this inbox report.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.