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

ANR before crash when SentryOptions.BeforeSendCallback returns null #2346

Closed
michal-chojnacki opened this issue Nov 8, 2022 · 2 comments · Fixed by #2368
Closed

ANR before crash when SentryOptions.BeforeSendCallback returns null #2346

michal-chojnacki opened this issue Nov 8, 2022 · 2 comments · Fixed by #2368
Assignees
Labels
Platform: Android Type: Bug Something isn't working

Comments

@michal-chojnacki
Copy link

Integration

sentry-android

Build System

Gradle

AGP Version

7.4

Proguard

Disabled

Version

5.7.4

Steps to Reproduce

  1. Create new blank project.
  2. Add sentry library
  3. Add AndroidManifest integration code
  4. Add config to build.gradle file:
sentry {
    tracingInstrumentation {
        enabled.set(false)
    }
    autoInstallation {
        enabled.set(false)
    }
}
  1. Run Sentry config in Application file:
    override fun onCreate() {
        super.onCreate()
        SentryAndroid.init(this, loggingOptions())
    }

    private fun loggingOptions() =
        Sentry.OptionsConfiguration<SentryAndroidOptions> { options ->
            options.beforeSend = SentryOptions.BeforeSendCallback { event, _ ->
                null
            }
        }
  1. Build project
  2. Run something which will throw unhandled exception

Expected Result

App should crash immediately

Actual Result

When unhandled exception happens UI freezes for few secs, ANR is shown and crash happens after some time.

Everything works correctly until v5.7.3. After bumping when SentryOptions.BeforeSendCallback returns null then we have ANR for few seconds before crash. When SentryOptions.BeforeSendCallback is returning some event then it also works correctly (crashing immediately).

@romtsn
Copy link
Member

romtsn commented Nov 14, 2022

hey, sorry for the troubles and thanks for the detailed report, we'll take a look at it soon and try to reproduce.

@romtsn romtsn self-assigned this Nov 15, 2022
@romtsn
Copy link
Member

romtsn commented Nov 15, 2022

found the cause - the fix is on its way and we'll try to ship it this or next week. Thanks for nailing down the version where it's started to pop up 👍

Repository owner moved this from Needs Discussion to Done in Mobile & Cross Platform SDK Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android Type: Bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants