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
If you enable the flag using the manifest config it works.
If you flip the flag using the Manual init of the Android SDK, it does not.
The reason is that we don't call registerActivityLifecycleCallbacks because isAttachScreenshot returns false when the event processor is created, the user configuration is triggered only after and later is too late.
Ideally we'd fix this logic https://github.com/getsentry/sentry-java/blob/main/sentry-android-core/src/main/java/io/sentry/android/core/ScreenshotEventProcessor.java#L50-L64=
We could technically install the lifecycle callback anyway and check when the very first process is called and call unregisterActivityLifecycleCallbacks if isAttachScreenshot is still disabled, there's a bit of overhead but I don't see any other solution right now.
Another way would be that Event processors have an install method similar to Integrations that are only called when the SDK is fully inited, but that would require more changes.
We could technically install the lifecycle callback anyway and check when the very first process is called and call unregisterActivityLifecycleCallbacks if isAttachScreenshot is still disabled, there's a bit of overhead but I don't see any other solution right now.
Description
If you enable the flag using the manifest config it works.
If you flip the flag using the Manual init of the Android SDK, it does not.
The reason is that we don't call
registerActivityLifecycleCallbacks
becauseisAttachScreenshot
returns false when the event processor is created, the user configuration is triggered only after and later is too late.Ideally we'd fix this logic https://github.com/getsentry/sentry-java/blob/main/sentry-android-core/src/main/java/io/sentry/android/core/ScreenshotEventProcessor.java#L50-L64=
We could technically install the lifecycle callback anyway and check when the very first
process
is called and callunregisterActivityLifecycleCallbacks
ifisAttachScreenshot
is still disabled, there's a bit of overhead but I don't see any other solution right now.Another way would be that Event processors have an
install
method similar to Integrations that are only called when the SDK is fully inited, but that would require more changes.Found this issue by debugging getsentry/sentry-react-native#2362
The text was updated successfully, but these errors were encountered: