Skip to content

Evaluate non-terminating session state for unhandled JS errors (captureEnvelopeNonTerminating / Session.State.Unhandled) #6659

Description

@antonis

Background

sentry-java 8.55.0 (#5921) added InternalSentrySdk.captureEnvelopeNonTerminating and Session.State.Unhandled so hybrid SDKs can report an unhandled error that does not terminate the process without ending the session as crashed. Flutter is adopting this.

Current RN behavior

RN has no dedicated session API over the bridge. A hard crash is signaled by the hardCrashed boolean on captureEnvelope:

  • hardCrashed is set only for mechanism { handled: false, type: 'onerror' }packages/core/src/js/misc.ts:11, computed in packages/core/src/js/wrapper.ts:196-235.
  • Native maps it directly: InternalSentrySdk.captureEnvelope(bytes, !hardCrashed)packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java:500-511. When hardCrashed, maybeStartNewSession=false and the current session ends as crashed.

Question / scope

Determine whether RN over-reports sessions as crashed for unhandled JS errors that don't actually terminate the native process, and if so, adopt captureEnvelopeNonTerminating + Session.State.Unhandled on Android to mark those sessions as unhandled instead. Requires bridging a new native path and a matching iOS/Cocoa equivalent before it can be wired end-to-end.

Follow-up from the 8.55.0 bump (#6658).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions