Closed jansi-z closed 2 years ago
@jansi-z Thanks for reporting this issue! I will work on a fix for this soon!
Hi @jansi-z I just deployed the new version v1.0.0-beta.4 including the fix. Feel free to upgrade the version and let me know how that goes. Thank you.
@qingzhuozhen Wow, thanks for picking this up so fast! I'll give it a try right away.
@qingzhuozhen My issue is fixed, so I'll close this! I'm getting variants now instead of an error. Thanks again for the fast response!
Expected Behavior
client = Experiment.new('123abc', Experiment::Config.new)
user = Experiment::User.new(user_id: 'foo')
variants = client.fetch(user)
variants
is defined as a hash that contains the variants for the user.Current Behavior
ERROR -- : [Experiment] Fetch failed: key not found: "payload"
Possible Solution
I added some breakpoints to
lib/experiment/client.rb
, and I discovered that the JSON returned by the Amplitude call did not return anypayload
field. So this bit of code fails. One way to solve this would be to changevalue.fetch('payload')
tovalue.fetch('payload', nil)
. It does look likeVariant
is able to handle anil
payload.Steps to Reproduce
See under 'Expected Behavior'. Let me know if more information is needed.
Environment