JS SDK | activate method sometime return null value
bhandaripuneet opened this issue · 9 comments
I am using 4.8.0 SDK version
I am trying to fetch experiment variant using activate method but sometimes it returns null with same argument values.
First i created instance using const instance = optimizely.createInstance(options)
Then using instance.activate gets null value sometime even with same argument value
**@optimizely/optimizely-sdk version: 4.8.0
Browser and version:
node version: v14.17.0
npm version: 6.14.13
Versions of any other relevant tools (like module bundlers, transpilers, etc.):
Thanks @bhandaripuneet. We'll review.
Also from localhost sometime datafile Ajax call throws error that it is not able to fetch data within 500 ms as timeout.
@bhandaripuneet Do you have logs or example code I can review?
Feel free to create a private personal repo and invite me to it to review. After reading back up on activate, I want to make sure I understand what you're seeing.
@mikechu-optimizely Sorry i cannot share codebase as its official. When i enabled debug then i am getting messages "OPTIMIZELY: Optimizely object is not valid. Failing activate."
Even datafile is present and it looks good
@mikechu-optimizely what do you think where is issue?
Totally understandable about not sharing the codebase as a whole. 👍
Is there a way we can collaborate over an extract of relevant files into a private, personal bhandaripuneet/js-issue-780 repo that you invite me to join? ...just an option especially if I need to bring other devs in to assist.
Otherwise, can you tell me if this activate call is made in the instance.onReady (like the example)?
Another thought (because you said "sometimes"): Are you making any async/await calls where the client isn't instantiated yet?
Cheers.
Hiya @bhandaripuneet,
Did you get a chance to track down some options for sharing or look deeper into when activate() is called?
Hope the investigation is going well.
-- Mike
Hi @bhandaripuneet,
My guess is that you've found a workaround at this point.
Please re-open or reference this issue if you're still having troubles.
--Mike