sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Errors shortly after SentryAndroid.init do not affect the session

Open adinauer opened this issue 2 years ago • 3 comments

Integration

sentry-android

Build System

Gradle

AGP Version

Proguard

Disabled

Version

6.4.1

Steps to Reproduce

Capture an exception right after SentryAndroid.init

Expected Result

A session is marked as errored and sent to Sentry.

We could start the session earlier. So instead of starting it when the App goes to the foreground (LifecycleWatcher.onStart) we could do it earlier. E.g. synchronously in init.

Actual Result

There is no session thus nothing is reported.

adinauer avatar Sep 13 '22 08:09 adinauer

Relates to: https://getsentry.atlassian.net/browse/FEEDBACK-1608

bruno-garcia avatar Sep 19 '22 19:09 bruno-garcia

Needs special handling for background starts.

adinauer avatar Sep 21 '22 14:09 adinauer

Should not start a new session if one's already running.

adinauer avatar Sep 21 '22 14:09 adinauer

Needs special handling for background starts.

@adinauer can you elaborate on this?

markushi avatar Nov 14 '22 08:11 markushi

@markushi I wrote this down as driver of the sync meeting. Can't remember who brought this up, probably @romtsn or @marandaneto. Maybe they can help out here 🙏

adinauer avatar Nov 14 '22 08:11 adinauer

I'm unsure as well but I'd suspect that could be related to if the user wants to manually init the Android SDK in a background thread instead of the auto init or via the Application#onCreate (main thread), if we need to sync something or make it as an atomic operation, just a hunch.

marandaneto avatar Nov 14 '22 10:11 marandaneto