Skip to content

When Android capture unhandled exception, let the app do not crash immediately, but instead give sentry several seconds to upload exceptions to server #1643

Description

@fzyzcjy

Platform:

  • Android -> If yes, which Device API (and compileSdkVersion/targetSdkVersion/Build tools) version?
  • Java -> If yes, which Java (and sourceCompatibility/targetCompatibility) version?
  • Kotlin -> If yes, which Kotlin (and jvmTarget) version?
  • NDK -> If yes, which NDK/CMake version?
  • React-Native -> If yes, which version?
  • Timber -> If yes, which version?
  • Log4j2 -> If yes, which version?
  • Logback -> If yes, which version?
  • Spring -> If yes, which version?

IDE:

  • Android Studio -> If yes, which version?
  • IntelliJ -> If yes, which version?
  • Other -> If yes, which one?

Build system:

  • Gradle -> If yes, which version?
  • Buck -> If yes, which version?
  • Bazel -> If yes, which version?
  • Maven -> If yes, which version?
  • Other -> If yes, which one?

Android Gradle Plugin:

  • Yes -> If yes, which version?
  • No

Sentry Android Gradle Plugin:

  • Yes -> If yes, which version?
  • No

Proguard/R8:

  • Enabled
  • Disabled

Platform installed with:

  • JCenter
  • Bintray
  • Maven Central
  • Manually

The version of the SDK:
sentry-flutter 5.0.0


I have the following issue:

We know that (getsentry/sentry-dart#548), if a crash happens, the user have to start the app again in order to let sentry upload the event to server. However, consider the following two cases:

  1. What if the app crash continuously when starting? In this case, sentry never have a chance to upload! This is almost the MOST severe bug an app can have, if it happens. But it even DOES NOT show up in sentry webpage!
  2. What if the user does not start the app again? For example, an impatient user. More importantly, a reviewer of the Android app store - often he just test once, see it crash, then reject this app without starting the app again. In this case, the app can never know the bug that the reviewer sees.

Proposal: show a dialog to user saying "bug occurred, please wait for several seconds", while sentry upload event to server in the backend. Instead of simply crashing and quit immediately.

Steps to reproduce:

  • see above

Actual result:

  • see above

Expected result:

  • see above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions