fix: Fix an issue with rollouts with a missing attribute.#153
Merged
Conversation
kinyoklion
commented
Jun 24, 2025
| ContextValue :: binary() | null) -> float(). | ||
| bucket_context_value(null, _FlagKey, _Salt, null) -> 0.0; | ||
|
|
||
| bucket_context_value(_Seed, _FlagKey, _Salt, null) -> 0.0; |
Member
Author
There was a problem hiding this comment.
So, the problem here was that both the seed and the value needed to be null in order to match this path.
When the bucket-able value is null we should bucket to 0, which is independent of the seed value.
61ca90d to
9f0dd01
Compare
kinyoklion
commented
Jun 24, 2025
| ] | ||
| }), | ||
| #{key => <<"flagKey">>, salt => <<"flagSalt">>}, | ||
| ldclient_context:new(<<"user-key">>)). |
Member
Author
There was a problem hiding this comment.
Context doesn't have the missing attribute.
kinyoklion
commented
Jun 24, 2025
| <<"kind">> => <<"rollout">>, | ||
| <<"contextKind">> => <<"user">>, | ||
| <<"bucketBy">> => <<"missing">>, | ||
| <<"seed">> => 1234567890, |
Member
Author
There was a problem hiding this comment.
Seed was required to hit this code path.
6f2bf13 to
62f680c
Compare
62f680c to
319ba0f
Compare
tanderson-ld
approved these changes
Jun 25, 2025
keelerm84
approved these changes
Jun 25, 2025
kinyoklion
pushed a commit
that referenced
this pull request
Jun 25, 2025
🤖 I have created a release *beep* *boop* --- ## [3.7.2](v3.7.1...v3.7.2) (2025-06-25) ### Bug Fixes * Fix an issue with rollouts with a missing attribute. ([#153](#153)) ([a94ed9c](a94ed9c)), closes [#152](#152) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a rollout had a seed, and the context being evaluated was missing the attribute referenced by
bucketBy, then thenullatom would attempt to be used as a binary.When the attribute is
null, then the bucket value should always be0.This doesn't affect the experimentation logic related to presence of the context itself.
Fixes: #152