Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add crashedLastRun #1125

Closed
philipphofmann opened this issue Dec 17, 2020 · 3 comments · Fixed by #1739
Closed

Add crashedLastRun #1125

philipphofmann opened this issue Dec 17, 2020 · 3 comments · Fixed by #1739

Comments

@philipphofmann
Copy link
Member

philipphofmann commented Dec 17, 2020

Add a callback crashedLastRun to SentryOptions that is called by the SDK passing the event
when Sentry is initialized and the last program execution terminated with a crash.

PR in Cocoa: getsentry/sentry-cocoa#808
Docs in Cocoa: https://docs.sentry.io/platforms/apple/enriching-events/user-feedback/

On Cocoa, we have the advantage that crashes get written to disk by SentryCrash and then the SDK processes them the next time the app starts. So we can check in the prepareEvent of the Client if the current event is a crash and call the callback.

On Java, this is a bit more tricky, because the crash event could be sent before the app shuts down. Therefore we need to store the eventID of the crash somewhere, so it is still there when the app starts the next time.

@marandaneto
Copy link
Contributor

related to #911

@bruno-garcia
Copy link
Member

We discussed that an update to the docs is due first: https://develop.sentry.dev/sdk/features/#user-facing-platforms

And that this callback will be taken via the public, static API so the user can call when they are ready to get their callback invoked/get the UI shown to the user.

@bruno-garcia bruno-garcia changed the title Add onCrashedLastRun Add crashedLastRun Aug 20, 2021
@bruno-garcia
Copy link
Member

We dropped the idea of using a callback here. Copying for #1569

Similar to the iOS API crashedLastRun: getsentry/sentry-cocoa/search (crashedlastrun)

We'd like to know if the previous execution resulted in a crash (via Java or Native) while on an Android app.
? This will be used by Unity (see getsentry/sentry-dotnet#1096)

This could live on SentryAndroid static class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants