Skip to content

refactor(ios): Migrate from PrivateSentrySDKOnly to SentrySDK.internal#6380

Open
alwx wants to merge 3 commits into
mainfrom
alwx/refactor/migrate-private-sentry-sdk-only
Open

refactor(ios): Migrate from PrivateSentrySDKOnly to SentrySDK.internal#6380
alwx wants to merge 3 commits into
mainfrom
alwx/refactor/migrate-private-sentry-sdk-only

fix(ios): Include visionOS in the RNSScreen swizzle bridge

330236b
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: find-bugs succeeded Jul 2, 2026 in 0s

No issues

find-bugs: Found 1 issue (1 low)

Low

UnsafeRawPointer escaped outside withUnsafePointer closure - `packages/core/ios/RNSentryInternal.swift:163-166`

In swizzleRNSScreenViewDidAppear, the UnsafeRawPointer produced inside withUnsafePointer(to: &rnsScreenViewDidAppearKey) { UnsafeRawPointer($0) } is returned from the closure and assigned to keyPtr, then used after the closure returns when passed to SentrySDK.internal.swizzle.instanceMethod(... key: keyPtr ...). Swift's API contract states the pointer argument is valid only for the duration of the closure body; escaping it is technically undefined behavior. In practice the pointer is only used as a stable identity token (never dereferenced) and rnsScreenViewDidAppearKey is a static var whose address is stable for the program lifetime, so real-world impact is negligible. To be spec-correct, take the address of the static property differently (e.g. UnsafeMutableRawPointer(&Self.rnsScreenViewDidAppearKey)) or perform the swizzle call inside the closure.


⏱ 13m 20s · 1.5M in / 118.3k out · $3.60