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
{{ message }}
Repository navigation
Variation methods do not validate key presence #177
...but this attribute is necessary to retrieve a live value, calling this with variation_detail will reveal that calls lacking the key attribute will not hit LaunchDarkly, and will instead provide the default value.
I believe this is a bug as it can cause subtle issues in users codebases without warning.
To reproduce
Call variation or variation_detail without a key attribute provided to the User hash.
Well, the behavior of returning the default value if the user has no key is not a bug— it's expected behavior, given that the key is a required property of all valid users and you can't evaluate flags without a valid user.
I agree that it'd be desirable to log a warning, just as it currently does if you pass a nil user. The other server-side SDKs, to my knowledge, do log a warning in that case and we should add similar behavior.
That would be great, mostly saw a few users footgunning on it earlier and was about to add a warning to our wrapper to make sure they knew that was the case.
Thanks for bringing it to our attention. We do try to keep the behavior for things like this consistent across all of the SDKs, and we clearly missed a point there. I've filed it as a bug, although I'm not sure what our time frame is for the next Ruby SDK release— it'll just depend on what else is going on.
Activity
eli-darkly commentedon Jul 13, 2021
Well, the behavior of returning the default value if the user has no key is not a bug— it's expected behavior, given that the key is a required property of all valid users and you can't evaluate flags without a valid user.
I agree that it'd be desirable to log a warning, just as it currently does if you pass a
niluser. The other server-side SDKs, to my knowledge, do log a warning in that case and we should add similar behavior.baweaver commentedon Jul 13, 2021
That would be great, mostly saw a few users footgunning on it earlier and was about to add a warning to our wrapper to make sure they knew that was the case.
eli-darkly commentedon Jul 13, 2021
Thanks for bringing it to our attention. We do try to keep the behavior for things like this consistent across all of the SDKs, and we clearly missed a point there. I've filed it as a bug, although I'm not sure what our time frame is for the next Ruby SDK release— it'll just depend on what else is going on.
eli-darkly commentedon Jul 15, 2021
We've released version 6.2.1 which adds this log warning.
Merge pull request #177 from launchdarkly/eb/sc-136090/eventsource-fixes