react-native-keychain icon indicating copy to clipboard operation
react-native-keychain copied to clipboard

UI animation freezing when calling any `set` functions in Android

Open jja08111 opened this issue 1 year ago • 1 comments

The UI animation freezes for around 200-300ms when calling any set functions in Android.

Minimal reproducible example

HomeScreen.tsx

export default function HomeScreen() {
  return (
    <View>
      <TouchableOpacity onPress={() => KeyChain.setInternetCredentials('name', 'username', 'password')}>
        <Text>Set keychain</Text>
      </TouchableOpacity>
    </View>
  );
}

Problem

I think the encryptString function should be run on another thread because the stream handling method causes the UI thread to block.

https://github.com/oblador/react-native-keychain/blob/4d88b620756f337de0e91aaac7ad4ffa3a4cb14e/android/src/main/java/com/oblador/keychain/cipherStorage/CipherStorageBase.java#L340-L367

Thank you for your attention.

jja08111 avatar Jun 20 '24 02:06 jja08111

this is a very urgent issue

lurdharry avatar Jun 24 '24 15:06 lurdharry

Fixed in 9.0.0

DorianMazur avatar Oct 03 '24 10:10 DorianMazur