BT-6886: fix: label unhandled promise rejections as 'Unhandled rejection'#370
Open
GT1990 wants to merge 1 commit into
Open
BT-6886: fix: label unhandled promise rejections as 'Unhandled rejection'#370GT1990 wants to merge 1 commit into
GT1990 wants to merge 1 commit into
Conversation
…promise rejections as 'Unhandled rejection' Adds 'Unhandled rejection' to BacktraceErrorType and uses it on the async error paths in browser, node, and react-native SDKs. Sync paths (window 'error' event, uncaughtException, RN ErrorBoundary, Android native) keep 'Unhandled exception'. Unhandled promise rejections and synchronous unhandled exceptions are distinct browser/node events with different crash semantics, but the JS SDKs were stamping both with error.type 'Unhandled exception'. The 'UnhandledPromiseRejection' classifier already captured the truth; the attribute now matches it. Customers can filter sync crashes from async noise without union queries. Verified end-to-end against a real Backtrace endpoint: async path submits with error.type 'Unhandled rejection', sync path still submits with 'Unhandled exception'.
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
'Unhandled rejection'toBacktraceErrorTypeand uses it on the async error paths in browser, node, and react-native SDKs. Sync paths (windowerrorevent,uncaughtException, RN error handler/boundary, Android native, React error boundary) keep'Unhandled exception'."Failed to fetch"events surface aserror.type: "Unhandled exception"even though they were unhandled promise rejections from Unity's WASM bootstrap fetch, not actual synchronous crashes.UnhandledPromiseRejectionclassifier already existed and was correct; theerror.typeattribute now matches it. Customers can filter sync crashes from async noise without union queries.Customer-facing behavior change
Dashboards and alerts filtering on
error.type = "Unhandled exception"will see fewer matches after this lands. Async rejections (likely the majority of browser/RN traffic) move toerror.type = "Unhandled rejection". Existing reports keep their old labels - no data migration.If you have hardcoded filters and want a combined view, union the two values.
What changed
packages/sdk-core/src/model/report/BacktraceErrorType.ts'Unhandled rejection'to the unionpackages/browser/src/BacktraceClient.tsunhandledrejectionlistener now uses new labelpackages/node/src/BacktraceClient.tsuncaughtExceptionMonitor(branched onorigin) and dedicatedunhandledRejectionlistener now use new labelpackages/react-native/src/handlers/UnhandledExceptionHandler.tspackages/*/tests/...unhandledErrorTests.spec.ts(3 new files)Test plan
npm run lintcleannpm test --workspace=@backtrace/sdk-core(320 tests)npm test --workspace=@backtrace/browser(59 tests, includes new regression)npm test --workspace=@backtrace/node(53 tests, includes new regression)npm test --workspace=@backtrace/react-native(36 tests, includes new regression)error.type: "Unhandled rejection", sync still"Unhandled exception". Two rxids confirmed in the test universe.