Closed tasn closed 4 years ago
Did you try to update this package to the most recent version? I think there were some issues with libsodium@1.0.13.
I'm on 0.3.8.
Please reread my report. It's not related to libsodium, it's because it's a slow operation and it needs to run in a worker thread rather than the RN thread.
Just following up on this, it should be a very easy fix.
@tsan: I've committed a version crypto_pwhash, which uses ExecutorService. You can test in your project. If it works OK we could publish a new build.
Great! What would you like me to test? Just a smoke test that it works?
Unfortunately though, as mentioned in https://github.com/lyubo/react-native-sodium/issues/35#issuecomment-701900738 I can't really update this library because of the bitcode incompatibility. :| Have you considered building the pre-compiled libs with an older xcode?
Just test if it stops blocking your application's UI. I've checked it with the example app and it passed the test.
This change only affects Android. As for building with an older xcode, I'll check what version is on my home PC, as a can't downgrade my office's one.
Seem to be much better! There's still a small lag on my device, but I wonder if it's just because of the sudden load on the system, rather than the thread blocking.
I consider this one fixed. Thanks!
As you can see in https://reactnative.dev/docs/native-modules-android#threading slow operations should be dispatched to their own worker thread on Android.
crypto_pwhash
is the only slow enough operation for which it matters so it should be called in an internal thread.