getsentry / team-mobile

Meta issues for the Mobile team
4 stars 1 forks source link

Errors shortly afterinit do not affect the session [meta] #50

Closed adinauer closed 2 years ago

adinauer commented 2 years ago

Steps to Reproduce

Capture an exception right after Sentry.init

Expected Result

A session is marked as crashed and sent to Sentry.

We could start the session earlier. Synchronously on init if autoSessionTracking is true.

This is how it's done in .NET. There, a session is also closed on Close, so that on restart, a file isn't found on disk with a 'unfinished' session. That way, we know not to finish that session as abnormal.

e.g: On Android, 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.

Affects Android https://github.com/getsentry/sentry-java/issues/2241 and Cocoa https://github.com/getsentry/sentry-cocoa/issues/2150

bruno-garcia commented 2 years ago

Customer issue: https://getsentry.atlassian.net/browse/FEEDBACK-1608

adinauer commented 2 years ago

Since we already have separate issues to track on the repos, closing this.