Skip to content

fix(ios): honor _experiments.enableUnhandledCPPExceptionsV2 on v8#6014

Open
antonis wants to merge 3 commits intoantonis/fix-ios-ui-profiling-optionsfrom
antonis/fix-ios-cpp-exceptions-v2
Open

fix(ios): honor _experiments.enableUnhandledCPPExceptionsV2 on v8#6014
antonis wants to merge 3 commits intoantonis/fix-ios-ui-profiling-optionsfrom
antonis/fix-ios-cpp-exceptions-v2

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented Apr 17, 2026

Note

Stacked on #6012. Review/merge that one first; once it lands, rebase this onto main.

📢 Type of change

  • Bugfix

📜 Description

Same dead-code drift as the profiling fix in #6012. SentrySDKWrapper.createOptionsWithDictionary parses _experiments.enableUnhandledCPPExceptionsV2 into sentryOptions.experimental.enableUnhandledCPPExceptionsV2 (ios/SentrySDKWrapper.m:105-108), but SentrySDKWrapper has not been on the live init path since #5582 moved init to RNSentryStart. So on iOS this option has been silently ignored in every 8.x release — user Sentry.init({ _experiments: { enableUnhandledCPPExceptionsV2: true } }) does not reach Cocoa.

(Verified Cocoa's SentryOptionsInternal.m does not auto-map _experiments.* from the raw dictionary — only top-level keys like enableLogs. So the gap is real.)

This PR extends the _experiments block introduced in #6012 to also port enableUnhandledCPPExceptionsV2 handling. Adds enabled / disabled / default XCTest coverage on RNSentryStart, mirroring the coverage SentrySDKWrapper already had but on the live path.

💡 Motivation and Context

User-facing: with enableUnhandledCPPExceptionsV2: true set in JS, iOS still falls back to the default handler, so C++ crashes don't get the more reliable __cxa_throw hooking. Same class of silent drop as the profiling regression — same fix pattern.

💚 How did you test it?

  • Three new XCTest cases on RNSentryStart:
    • testStartCreateOptionsWithDictionaryEnableUnhandledCPPExceptionsV2Enabled → asserts actualOptions.experimental.enableUnhandledCPPExceptionsV2 == YES
    • …Disabled → asserts == NO
    • …Default (no _experiments key) → asserts == NO
  • Locally: yarn build, yarn circularDepCheck, ./scripts/clang-format.sh lint all clean.

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

Same dead-code issue as the profiling fix — `SentrySDKWrapper` parses
`_experiments.enableUnhandledCPPExceptionsV2`, but `RNSentryStart` (the
live init path since v8.0.0) does not. Port the handling into the
`_experiments` block just introduced for `profilingOptions`, and add
enabled/disabled/default XCTest coverage on `RNSentryStart`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 17, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • fix(ios): honor _experiments.enableUnhandledCPPExceptionsV2 on v8 by antonis in #6014
  • chore(deps): update JavaScript SDK to v10.49.0 by github-actions in #6011
  • fix(profiling): iOS UI profiling on v8 by antonis in #6012
  • ci: Integrate Warden for AI-powered PR code review by antonis in #6003
  • chore(lint): Fixes lint issue on main by antonis in #6013
  • feat(expo): Warn when prebuilt native projects are missing Sentry config by alwx in #5984

🤖 This preview updates automatically when you update the PR.

…ios-cpp-exceptions-v2

# Conflicts:
#	CHANGELOG.md
@sentry
Copy link
Copy Markdown

sentry bot commented Apr 17, 2026

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.8.0 (83) Release

⚙️ sentry-react-native Build Distribution Settings

@github-actions
Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1247.35 ms 1233.88 ms -13.47 ms
Size 3.38 MiB 4.76 MiB 1.38 MiB

@github-actions
Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1217.37 ms 1221.53 ms 4.16 ms
Size 3.38 MiB 4.76 MiB 1.38 MiB

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

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants