Skip to content

rfc(feature): Capture assertion violations as non-fatal error events - #165

Draft
antonis wants to merge 6 commits into
mainfrom
feat/assertion-instrumentation-rfc
Draft

antonis wants to merge 6 commits into
mainfrom
feat/assertion-instrumentation-rfc

Conversation

@antonis

@antonis antonis commented Sep 25, 2026 •

Copy link
Copy Markdown

This RFC proposes turning assertion violations (invariant, assert, precondition, Debug.Assert, console.assert, and similar) into grouped, non-fatal Sentry error events, instead of letting them be stripped from release builds or crash with unreadable minified messages.

It has two parts: a cross-SDK convention and runtime API (mechanism.type = "assertion" plus captureAssertionViolation()), and an opt-in build-time transform that instruments assertion call sites with no app source changes. A working React Native reference implementation exists in getsentry/sentry-react-native#6592.

Rendered RFC

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