Context
When the iOS init path was moved from SentrySDKWrapper to RNSentryStart in v8 (via #5582 / sub-PR #4442), only the call sites were repointed — the old option-parsing methods in SentrySDKWrapper were left in place "just in case," along with their XCTest suite. Nothing in production calls them anymore, but the tests kept passing, which is precisely how two bugs shipped in every 8.x release until we noticed:
The dead code also parses enableLogs (harmless — Cocoa's dict parser handles it), enableNativeCrashHandling, spotlight, etc. — all duplicated in RNSentryStart today.
Why this matters
As long as SentrySDKWrapper.createOptionsWithDictionary and its test coverage exist, any future author who wants to add a new option or _experiments.* field has two visually-equivalent files to update, no signal about which one is live, and XCTest runs that pass even when the live path is broken. That's exactly the setup that produced the two bugs above — the #5611 author added the profiling block to SentrySDKWrapper because it looked like the right file.
What to do
-
In packages/core/ios/SentrySDKWrapper.{h,m}, delete:
createOptionsWithDictionary:isSessionReplayEnabled:error:
setupWithDictionary:isSessionReplayEnabled:error:
startWithOptions: (the internal one that the above methods call)
Keep the methods that are still used from RNSentry.mm: crash, close, crashedLastRun, configureScope:, debug, releaseName, enableAutoSessionTracking, enableWatchdogTerminationTracking. (Grep SentrySDKWrapper in RNSentry.mm for the exact list; it's ~10 call sites.)
-
In packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.m, delete the [SentrySDKWrapper createOptionsWithDictionary:…] tests (~lines 34–1065 in the current file). For any assertion in there that covers behavior still worth testing but not already covered by the RNSentryStart Tests block (e.g., the ignoreErrors filtering tests), migrate the test to use RNSentryStart createOptionsWithDictionary: / startWithOptions: instead.
-
Keep the remaining RNSentryStart-based tests as the single source of truth for init-path behavior.
Acceptance
grep -r 'SentrySDKWrapper createOptionsWithDictionary\|SentrySDKWrapper setupWithDictionary' packages/core returns nothing.
xcodebuild test (Cocoa suite) stays green.
- No orphaned
#import "SentrySDKWrapper.h" in the tests if nothing else from the header is used.
Notes
Context
When the iOS init path was moved from
SentrySDKWrappertoRNSentryStartin v8 (via #5582 / sub-PR #4442), only the call sites were repointed — the old option-parsing methods inSentrySDKWrapperwere left in place "just in case," along with their XCTest suite. Nothing in production calls them anymore, but the tests kept passing, which is precisely how two bugs shipped in every 8.x release until we noticed:_experiments.profilingOptionssilently dropped on iOS — fixed in fix(profiling): iOS UI profiling on v8 #6012_experiments.enableUnhandledCPPExceptionsV2silently dropped on iOS — fixed in fix(ios): honor _experiments.enableUnhandledCPPExceptionsV2 on v8 #6014The dead code also parses
enableLogs(harmless — Cocoa's dict parser handles it),enableNativeCrashHandling,spotlight, etc. — all duplicated inRNSentryStarttoday.Why this matters
As long as
SentrySDKWrapper.createOptionsWithDictionaryand its test coverage exist, any future author who wants to add a new option or_experiments.*field has two visually-equivalent files to update, no signal about which one is live, and XCTest runs that pass even when the live path is broken. That's exactly the setup that produced the two bugs above — the #5611 author added the profiling block toSentrySDKWrapperbecause it looked like the right file.What to do
In
packages/core/ios/SentrySDKWrapper.{h,m}, delete:createOptionsWithDictionary:isSessionReplayEnabled:error:setupWithDictionary:isSessionReplayEnabled:error:startWithOptions:(the internal one that the above methods call)Keep the methods that are still used from
RNSentry.mm:crash,close,crashedLastRun,configureScope:,debug,releaseName,enableAutoSessionTracking,enableWatchdogTerminationTracking. (GrepSentrySDKWrapperinRNSentry.mmfor the exact list; it's ~10 call sites.)In
packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.m, delete the[SentrySDKWrapper createOptionsWithDictionary:…]tests (~lines 34–1065 in the current file). For any assertion in there that covers behavior still worth testing but not already covered by theRNSentryStart Testsblock (e.g., theignoreErrorsfiltering tests), migrate the test to useRNSentryStart createOptionsWithDictionary:/startWithOptions:instead.Keep the remaining
RNSentryStart-based tests as the single source of truth for init-path behavior.Acceptance
grep -r 'SentrySDKWrapper createOptionsWithDictionary\|SentrySDKWrapper setupWithDictionary' packages/corereturns nothing.xcodebuild test(Cocoa suite) stays green.#import "SentrySDKWrapper.h"in the tests if nothing else from the header is used.Notes