Skip to content

Fix SDK init crash if initialized from background thread #4449

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

Merged
merged 4 commits into from
May 26, 2025

Conversation

markushi
Copy link
Member

@markushi markushi commented May 26, 2025

📜 Description

androidx.core.view.GestureDetectorCompat crashes if the constructor is called from a non-main thread. We're hitting this code path if:

  • the init is manual & deferred
  • the init is executed on a background thread
  • if there's an active resumed Activity already running
  • if the SDK is initialized with an app context

On top of that we should gracefully handle integration.register, similar to integration.close.

Fixes #4438

💡 Motivation and Context

No SDK crashes.

💚 How did you test it?

So far only manual tests.

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@markushi markushi changed the title Fix Sdk crashes if initialized from background thread Fix SDK init crash if initialized from background thread May 26, 2025
Copy link
Contributor

github-actions bot commented May 26, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 445.56 ms 543.23 ms 97.67 ms
Size 1.58 MiB 2.08 MiB 510.85 KiB

Previous results on branch: markushi/fix/sdk-crash-background-init

Startup times

Revision Plain With Sentry Diff
d0556a4 419.49 ms 445.75 ms 26.26 ms

App size

Revision Plain With Sentry Diff
d0556a4 1.58 MiB 2.08 MiB 510.85 KiB

@markushi markushi merged commit 706fa69 into main May 26, 2025
34 checks passed
@markushi markushi deleted the markushi/fix/sdk-crash-background-init branch May 26, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy