fix(browser): downgrade non-Error unhandled rejections to warnings - #5
Merged
sagnik11 merged 1 commit intoAug 4, 2026
Conversation
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
marked this pull request as ready for review
August 4, 2026 17:02
sagnik11
approved these changes
Aug 4, 2026
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
$exceptionissue opened forNon-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.autter-website-new, a separate repo) — the direct fix for it (abefore_sendfilter + suppressing the existing issue) lives there and in the PostHog UI, not in this repo. See the report below.unhandledrejectionhandler reports a non-Error rejection — no stack, no real type — at the defaulterrorseverity, so customers shipping it will mint spurious first-class issues from injected-script noise too.Change
warninginstead oferror, so they no longer open a first-class error/issue.beforeSendcan 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 (
asSeverityinnormalize-browser.ts), so warning-level rejections flow through and group correctly.Scope / what this does NOT do
autter-website-newand needs its ownbefore_sendfilter plus issue suppression in error tracking.Verification
buildsucceeds; size-limit 1.1 kB (limit 5 kB).tsc --noEmitclean.Agent context
autter-website-newis not present here, so the posthog-js filter could not be applied in this PR.Created with PostHog Desktop from this inbox report.