Skip to content

Add crashedLastRun #1125

Closed
Closed

Description

@philippsuess

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.

Activity

  1. marandaneto commented on Jan 4, 2021

    @marandaneto
    Contributor

    related to #911

  2. bruno-garcia commented on Jan 18, 2021

    @bruno-garcia
    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.

  3. changed the title [-]Add onCrashedLastRun[/-] [+]Add crashedLastRun[/+] on Aug 20, 2021
  4. bruno-garcia commented on Aug 20, 2021

    @bruno-garcia
    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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions