Skip to content

fix(frontend): suppress posthog-js internal request-timeout abort - #3332

Draft
posthog-eu[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixfrontend-suppress-posthog-sdk-26c45b
Draft

posthog-eu[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixfrontend-suppress-posthog-sdk-26c45b

Conversation

@posthog-eu

@posthog-eu posthog-eu Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The error tracking issue AbortError: PostHog request timed out after 3000ms is 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.
  • The abort is reported inside the bundled posthog-js core (buildOtlpLogRecord → _processInitTaskQueue), so the reverse proxy at psthg.capgo.app, an offline tab, or a page unload is enough to trip it.
  • Fix: add one anchored pattern to TRANSIENT_NETWORK_ERROR_PATTERNS in src/services/staleAssetErrors.ts, which before_send in src/services/posthog.ts already 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+ms covers both the 3000ms message and the earlier 10000ms variant.
  • The optional (?:.*: )? prefix matches the wording either bare or with the AbortError: 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, the AbortError: 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

  • My code follows the code style of this project and passes
    bun run lint:backend && bun run lint.
  • My change requires a change to the documentation.
  • I have updated the documentation
    accordingly.
  • My change has adequate E2E test coverage.
  • I have tested my code manually, and I have provided steps how to reproduce
    my tests

Created with PostHog Desktop from this inbox report.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Review in cubic

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
@posthog-eu
posthog-eu Bot deployed to deepsec-pr September 14, 2026 15:08 Active
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 7d344c4f-6ea7-4a4f-a414-1600911c6827

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codspeed

codspeed Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing posthog-self-driving/fixfrontend-suppress-posthog-sdk-26c45b (7b4af7d) with main (eff31d2)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@sonarqubecloud

Copy link
Copy Markdown

This branch was successfully deployed

1 active deployment
deepsec-pr — 7b4af7df Deployed Sep 14, 2026 by posthog-eu[bot] via Scan PR changes #6988
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.

0 participants