You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to the revert in #6491 (which reverted #6380 to fix the iOS screenshot regression #6497).
Background
#6380 migrated iOS code from PrivateSentrySDKOnly to the new SentrySDK.internal Swift API. It shipped in 8.19.0 and broke all iOS screenshot capture (Feedback Widget screenshot, attachScreenshot, Sentry.captureScreenshot()) — see #6497. #6491 reverts #6380 as an interim fix.
Root cause (sentry-cocoa)
Any access to SentrySDK.internal constructs SentryInternalApi, whose initeagerly readsSentryDependencyContainer.screenshotSource. That property is a lazy var whose builder returns nil while startOptions is unset, and — being lazy — that nil is cached permanently. Because RN touches SentrySDK.internal before SentrySDK.start (from RNSentryStart and from JS integrations calling native methods like fetchNativeAppStart/fetchNativeSdkInfo during init), screenshotSource gets poisoned to nil and stays nil for the process lifetime.
A targeted RN-side fix is unreliable (any pre-start SentrySDK.internal access poisons it, and JS controls the timing), which is why we reverted the whole migration.
What needs to happen
Fix in sentry-cocoa — screenshotSource (and the other startOptions-gated lazy providers, e.g. viewHierarchyProvider) must not permanently cache nil. Options:
Make screenshotSource a computed property instead of a lazy var so getOptionalLazyVar rebuilds it once startOptions is available; and/or
Have SentryInternalApi read the providers lazily at use-time rather than eagerly in init.
Bump the sentry-cocoa dependency in RN to the fixed version.
Reapplying refactor(ios): Migrate from PrivateSentrySDKOnly to SentrySDK.internal #6380 also restores its two bundled improvements that the revert removed: the fetchViewHierarchy nil-guard (returns null instead of a zero-byte attachment on capture failure) and the RNSentryTimeToDisplayextern linkage change.
A dedicated sentry-cocoa issue should track item (1).
Follow-up to the revert in #6491 (which reverted #6380 to fix the iOS screenshot regression #6497).
Background
#6380 migrated iOS code from
PrivateSentrySDKOnlyto the newSentrySDK.internalSwift API. It shipped in 8.19.0 and broke all iOS screenshot capture (Feedback Widget screenshot,attachScreenshot,Sentry.captureScreenshot()) — see #6497. #6491 reverts #6380 as an interim fix.Root cause (sentry-cocoa)
Any access to
SentrySDK.internalconstructsSentryInternalApi, whoseiniteagerly readsSentryDependencyContainer.screenshotSource. That property is alazy varwhose builder returnsnilwhilestartOptionsis unset, and — beinglazy— thatnilis cached permanently. Because RN touchesSentrySDK.internalbeforeSentrySDK.start(fromRNSentryStartand from JS integrations calling native methods likefetchNativeAppStart/fetchNativeSdkInfoduring init),screenshotSourcegets poisoned toniland staysnilfor the process lifetime.A targeted RN-side fix is unreliable (any pre-start
SentrySDK.internalaccess poisons it, and JS controls the timing), which is why we reverted the whole migration.What needs to happen
screenshotSource(and the otherstartOptions-gated lazy providers, e.g.viewHierarchyProvider) must not permanently cachenil. Options:screenshotSourcea computed property instead of alazy varsogetOptionalLazyVarrebuilds it oncestartOptionsis available; and/orSentryInternalApiread the providers lazily at use-time rather than eagerly ininit.feedbackE2E flow stays green on iOS.Notes
fetchViewHierarchynil-guard (returnsnullinstead of a zero-byte attachment on capture failure) and theRNSentryTimeToDisplayexternlinkage change.Related: #6380, #6491, #6497