Repository navigation
fix(ios): Start native SDK without options file - #6956
Merged
antonis merged 1 commit intoOct 28, 2026
Merged
Conversation
trollixx
force-pushed
the
fix/ios-native-init-missing-options
branch
2 times, most recently
from
October 28, 2026 01:46
e0e1077 to
ac496f9
Compare
RNSentrySDK fell back to parsing an empty dictionary when sentry.options.json was missing or could not be parsed. Cocoa reads a missing "dsn" key as an empty DSN and rejects it, so the fallback always failed and configureOptions never ran. Before 8.30.0 this crashed at launch; since then the native SDK silently never starts. Fall back to default SentryOptions instead, and skip the start only when neither the file nor configureOptions set a valid DSN, so that a later init from JS can still start the native SDK. Register RNSentryStartTests, RNSentryStartFromFileTests and their fixtures in the Cocoa tester project again. They were lost when getsentry#5582 landed and have not run since. Update them for Cocoa 9 and add regression tests for a DSN set in configureOptions.
trollixx
force-pushed
the
fix/ios-native-init-missing-options
branch
from
October 28, 2026 01:54
ac496f9 to
77924c6
Compare
antonis
self-requested a review
October 28, 2026 09:08
5 of 11 tasks
3 tasks done
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.
📢 Type of change
📜 Description
When
sentry.options.jsonis missing or can't be parsed,RNSentrySDKfalls back tooptionsFromDictionary:@{ }. Cocoa reads the missingdsnkey as an empty DSN and rejects it, so the fallback always returns nil andconfigureOptionsnever runs. Before 8.30.0 this crashed at launch; since #6825, the native SDK silently never starts.This PR falls back to default
SentryOptionsinstead, and skips the start only if neither the file norconfigureOptionsset a valid DSN, so JS can still initialize the native SDK later. The now-unreachable nil guard inRNSentrySDK.mis removed.Behavior change: an options file with
"dsn": nullused to start a native SDK that couldn't send events. It now skips the start.💡 Motivation and Context
An iOS app without
sentry.options.jsonthat sets the DSN in[RNSentrySDK startWithConfigureOptions:]never starts the native SDK. Android already handles this case.Related: #6822, #6825.
💚 How did you test it?
The tests for this path (
RNSentryStartFromFileTests.swift,RNSentryStartTests.swift) lost theirproject.pbxprojentries when #5582 landed and haven't run since. This PR registers them and their fixtures again, updates them for Cocoa 9, and adds regression tests for a DSN set inconfigureOptionswith a missing or unparseable options file.I haven't built or run the tester locally (no Mac), so I'm relying on CI.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps