fix(web): drop opaque script error exceptions in posthog - #2551
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(web): drop opaque script error exceptions in posthog#2551cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Safari-only "Script error." events from email-campaign traffic have no stack frames and cannot be attributed to app code. Filter them in before_send like other known-unactionable noise, while keeping any payload that still carries frames. Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
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.
Summary
PostHog showed new production volume on 2026-08-02 for
Error: Script error.(5 occurrences / 2 users / 2 sessions), all Safari (desktop + iOS), all from the August email campaign (utm_source=email&utm_campaign=august), on/lifeand/week.Every sample was synthetic,
$exception_handled: false, and had no stack frames. Compass loads only same-origin/index.jsas a module — real app exceptions report useful messages and frames. OpaqueScript error.here is the browser sanitizing a cross-origin failure (extension / in-app browser / third-party inject), which matches the existing CefSharp / network-noise filter policy.Also confirmed during triage:
Selected event not foundspiked earlier the same day and is already fixed/resolved by #2549 (merged ~3 minutes after last occurrence).Change: drop
$exceptionevents whose value is exactlyScript error.and that have no stack frames infilterPosthogBeforeSend. Keep any payload that somehow still has frames.Simplicity
One exact-message check in the existing
before_sendfilter, plus a frames guard so we never discard a stack-bearing event.Automated validation
index.html.Independent review
Focused diff review of the filter + tests: exact-message match, frames guard, no change to capture_console_errors / ApiError paths.
Test plan
Remaining risk
Script error.with zero frames (should not happen for this app's script loading), it would be dropped; actionable app bugs still report real messages + frames.Error signatures addressed
Error: Script error.(issue)