jerson / react-native-fast-openpgp

OpenPGP for react native made with golang for fast performance
https://www.npmjs.com/package/react-native-fast-openpgp
MIT License
45 stars 18 forks source link

JSI functions cannot be initialized in a threaded manner (race condition) #99

Closed ospfranco closed 9 months ago

ospfranco commented 9 months ago

Hi there. I client is having an issue with this module. When he turned on the JSI flag, he started experiencing a crash on the install method. I took a look and found out the initialization of JSI functions is happening in an async method, but this is basically a race condition, so it will always have a possibility of a thread error.

sure

The only way to guarantee the will be no race conditions is to make the install function synchronous and blocking. Otherwise, whenever you try to do any operation with the jsiRuntime you might get the same thread error.

jerson commented 9 months ago

Hi @ospfranco thanks for report this issue, I didn't know about this possibility, I can take some time this weekend to apply this

jerson commented 9 months ago

@ospfranco thanks for the support, could you try using the new PR just created https://github.com/jerson/react-native-fast-openpgp/pull/101

jerson commented 9 months ago

new version released: https://www.npmjs.com/package/react-native-fast-openpgp/v/2.7.2 feel free to reopen the issue if needed