-
-
Notifications
You must be signed in to change notification settings - Fork 520
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
[Fix][Android] Avoid blocking threads to prevent deadlocks #576
Conversation
For reanimated related issues, please refer to this PR and thread software-mansion/react-native-reanimated#3440 |
Thanks @androideveloper for referring me to that thread! Glad to know something is also being done on the reanimated side to fix it. |
I experienced the same issue and could resolve by using the version from this PR, all tests so far are successful. Is there anything I can support with to get this change / fix merged into upstream? |
@oblador Any chance you could take a look at this, seems like it's still affecting a few folks |
Any progress / blockers on this PR? Can we prioritize this? |
Hi @frw! I'm going to have a look at your PRs in this repo. Did you already test these changes in a real app? |
@NonNull final byte[] username, | ||
@NonNull final byte[] password, | ||
@NonNull final SecurityLevel level) | ||
public void decrypt(@NonNull final DecryptionResultHandler handler, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is handler not used anymore?
19f4b47
to
5359610
Compare
Fixed in 9.0.0 |
Similar to #547, I've run into issues with main thread deadlocking when using this library to show a BiometricPrompt and have seen an increased rate of ANRs on Crashlytics.
Upon further digging it was due to
react-native-reanimated
attempting to acquire a lock on the main thread, but since this library waits on the JS thread for the BiometricPrompt to show and finish on the main thread, a deadlock occurs.This library avoids blocking the JS thread by using a listener to resolve a promise when decryption finishes. Since there are no additional dependencies, this should be compatible up to API level 21.
This PR should fix #525