### 🔧 Tech
* Migrate all AsyncStorage direct calls to our storage wrapper
Now every react-native-async-storage calls are centralized in our storage wrapper. This is a prerequisite to potentially migrate to react-native-mmkv or another library.
Some cases I encountered
a JSON object is stored stringified with AsyncStorage.setItem and is parsed after AsyncStorage.getItem
=> because getData and storeData already does the stringify/parse, I removed the remaining JSON.stringify and JSON.parse calls when migrating to getData and storeData. Ex. : Bundle, Oauth
a string is stored directly with AsyncStorage.setItem
=> getData will try to parse a not stringified string if there is already a value stored directly with AsyncStorage.setItem. I added a compatibilty check. Ex. : DefaultRedirectionUrl
What did I test
Logging in with previous app version (master) ; migrate to this version; use the app
Logging in with this version; use the app
Checklist
Before merging this PR, the following things must have been done if relevant:
Now every react-native-async-storage calls are centralized in our storage wrapper. This is a prerequisite to potentially migrate to react-native-mmkv or another library.
Some cases I encountered
AsyncStorage.setItem
and is parsed afterAsyncStorage.getItem
=> because getData and storeData already does the stringify/parse, I removed the remainingJSON.stringify
andJSON.parse
calls when migrating to getData and storeData. Ex. : Bundle, OauthAsyncStorage.setItem
=> getData will try to parse a not stringified string if there is already a value stored directly withAsyncStorage.setItem
. I added a compatibilty check. Ex. : DefaultRedirectionUrlWhat did I test
Checklist
Before merging this PR, the following things must have been done if relevant: