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.
SDK fallback to persistence: memory if storage libs aren't installed.
Added a test but it failed because of https://github.com/facebook/react-native/issues/35701 so I removed it, I tested the code at runtime though.
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 tomemory
, 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 https://github.com/PostHog/posthog-js-lite/issues/143
Changes
SDK fallback to
persistence: memory
if storage libs aren't installed. Added a test but it failed because of https://github.com/facebook/react-native/issues/35701 so I removed it, I tested the code at runtime though.Release info Sub-libraries affected
Bump level
Libraries affected
Changelog notes