Skip to content

fix(browser): downgrade non-Error unhandled rejections to warnings - #5

Merged
sagnik11 merged 1 commit into
mainfrom
posthog-self-driving/fixwebsite-filter-injected-non-error-b79b51
Aug 4, 2026
Merged

fix(browser): downgrade non-Error unhandled rejections to warnings#5
sagnik11 merged 1 commit into
mainfrom
posthog-self-driving/fixwebsite-filter-injected-non-error-b79b51

Conversation

@posthog

@posthog posthog Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Problem

  • A noise $exception issue opened for Non-Error promise rejection captured with value: Object Not Found Matching Id:4, MethodName:update, ParamCount:4 — the well-known artifact of a Microsoft Outlook-family link/email scanner injecting a script that rejects a promise with a plain object. The string exists nowhere in Autter source.
  • Zero user impact: a single Chrome/Windows session, a sub-second burst, no recurrence. The only cost is triage attention sitting next to real errors.
  • The observed event was captured by posthog-js on the marketing site (autter-website-new, a separate repo) — the direct fix for it (a before_send filter + suppressing the existing issue) lives there and in the PostHog UI, not in this repo. See the report below.
  • This repo's SDK has the same class of gap: the browser runtime's unhandledrejection handler reports a non-Error rejection — no stack, no real type — at the default error severity, so customers shipping it will mint spurious first-class issues from injected-script noise too.

Change

  • Non-Error promise rejections are now reported as warning instead of error, so they no longer open a first-class error/issue.
  • Still captured and visible for debugging; a customer's beforeSend can drop them entirely. Error-typed rejections are unchanged.
  if (isError) {
      e.errorType = reason.name;
      if (reason.stack) e.stack = String(reason.stack).slice(0, 32000);
+ } else {
+     // no stack, no meaningful type — almost always injected 3rd-party
+     // scripts, not a real app fault. Warn, don't raise a first-class issue.
+     e.severity = "warning";
  }

The ingester already honors an SDK-supplied severity (asSeverity in normalize-browser.ts), so warning-level rejections flow through and group correctly.

Scope / what this does NOT do

  • Does not change the observed marketing-site event — that originates from posthog-js in autter-website-new and needs its own before_send filter plus issue suppression in error tracking.
  • This is the in-repo half of the report's proposal: hardening Autter's own SDK against the same noise class. Additive and low-risk.

Verification

  • build succeeds; size-limit 1.1 kB (limit 5 kB). tsc --noEmit clean.

Agent context

  • Confirmed no competing open PRs/branches/issues on this repo. autter-website-new is not present here, so the posthog-js filter could not be applied in this PR.

Created with PostHog Desktop from this inbox report.

A rejected promise whose reason isn't an Error carries no stack and no
meaningful type. In practice these are almost always injected third-party
scripts (email/link scanners, browser extensions) rejecting a plain value,
not real app faults. Reporting them at the default `error` severity opens a
first-class issue for pure noise.

Report them as `warning` instead: still captured and visible for debugging,
but they no longer sit alongside real errors, and `beforeSend` can drop them
entirely. Error-typed rejections are unchanged.

Generated-By: PostHog Code
Task-Id: d67e689e-e9cc-4d3d-8166-36e2e3333894
@sagnik11
sagnik11 marked this pull request as ready for review August 4, 2026 17:02
@sagnik11
sagnik11 merged commit a107930 into main Aug 4, 2026
1 check passed
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.

1 participant