If async-storage
or expo-file-system
is not installed, the SDK will fallback to persistence: memory
and log a warning
#146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
If you install the PH SDK in a clean sample app and run
yarn test
, the test will fail because the PH SDK needs the storage libs but they aren't available for other targets than Android and iOS.The only option is to mock the libs or set the persistence to
memory
, both are not great as a first experience when using our SDK so it's better to use a fallback instead of throwing an error and letting the user figure it out.Fixes #143
Changes
SDK fallback to
persistence: memory
if storage libs aren't installed.Added a test but it failed because of facebook/react-native#35701 so I removed it, I tested the code at runtime though.
Release info Sub-libraries affected
Bump level
Libraries affected
Changelog notes