You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I use a OptimizelyProvider that on first render has user undefined, then the isReady() method of the optimizely client will always return false, even if the user is set later.
It seems to be related to this change that added verification for isUserReady to isReady(): 62a12ff#diff-25d66d74617fe2e23d7946bd6e3ba95640ab1b9bc8947445d604fc271c7c1f12R447
Copy the .env.development file to a new .env.local file in the root of the project and set your optimizely key in it
Run npm install
Run npx expo prebuild --clean
Run the app with npx expo run:ios (or npx expo run:android)
Tap on the "Re-check" button, see the "Optimizely Ready" field remains false. Try again by tapping on "Set user info", then again on "Re-check", see it still says "false"
3.2.3.mp4
Close the app and metro bundler
Switch to branch 3.2.2 (which has @optimizely/react-sdk downgraded to 3.2.2)
Run npm install
Run npx expo prebuild --clean
Run the app with npx expo run:ios (or npx expo run:android)
Tap on the "Re-check" button, see the "Optimizely Ready" field changes to true
Is there an existing issue for this?
SDK Version
3.2.3
Current Behavior
If I use a OptimizelyProvider that on first render has user undefined, then the
isReady()
method of the optimizely client will always return false, even if the user is set later.It seems to be related to this change that added verification for isUserReady to isReady(): 62a12ff#diff-25d66d74617fe2e23d7946bd6e3ba95640ab1b9bc8947445d604fc271c7c1f12R447
isUserReady
seems to be changed only once here - https://github.com/optimizely/react-sdk/blob/3.2.3/src/client.ts#L252 - afteruserReadyPromise
is resolved here whensetUser
is called first time (e.g. from OptimizelyProvider) - https://github.com/optimizely/react-sdk/blob/3.2.3/src/client.ts#L410. IfsetUser
was called with the default user (with id = null), then the promise gets resolved with{ success: false }
, thusisUserReady
will remain false and never change again.Expected Behavior
isReady()
should return true at some point when the optimizely client is ready.Steps To Reproduce
.env.development
file to a new.env.local
file in the root of the project and set your optimizely key in itnpm install
npx expo prebuild --clean
npx expo run:ios
(ornpx expo run:android
)3.2.3.mp4
@optimizely/react-sdk
downgraded to 3.2.2)npm install
npx expo prebuild --clean
npx expo run:ios
(ornpx expo run:android
)3.2.2.mp4
React Framework
No response
Browsers impacted
No response
Link
https://github.com/mlazari/OptimizelyRepro/blob/main/app/index.tsx
Logs
No response
Severity
Blocking development
Workaround/Solution
Downgrading to 3.2.2 for now.
Recent Change
No response
Conflicts
No response
The text was updated successfully, but these errors were encountered: