Skip to content

fix: Return the default value for a flag that has no value - #656

Draft
kinyoklion wants to merge 1 commit into
mainfrom
rlamb/sdk-3689/null-flag-value-default
Draft

kinyoklion wants to merge 1 commit into
mainfrom
rlamb/sdk-3689/null-flag-value-default

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

When the flag data for a flag had a null value or no value, JsonVariation and JsonVariationDetail returned null instead of the default value. A flag without a value cannot give a result, so the SDK now returns the default value, with the reason and variation index of the flag data, as js-core does. The typed variation methods already returned the default value with a WRONG_TYPE reason, and they do not change.

Testing: a new client test fails before the change and passes after it. The harness tests for a null or omitted flag value in stream put and patch events and in a poll response change from fail to pass with the Beast and CURL builds. The full v2 contract suite with the Beast and CURL builds shows no other change.

SDK-3689

Opened from termag

When the flag data had a null value or no value, the JSON variation
methods returned null instead of the default value.

Generated-by: termag

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant