Skip to content

Commit

Permalink
fix: Honor explicitly set default value (#271)
Browse files Browse the repository at this point in the history
When evaluating flags, the test harness has relied on the
[`inferDefaultFromFlag`][1] to replace an explicitly null value with an
inferred default value of the correct type.

This kind of magic only leads to confusion (hence this PR), and isn't
necessary. SDKs should be able to handle a null default as well as any
other type.

[1]:
https://github.com/launchdarkly/sdk-test-harness/blob/cb433a1206c5190796c021605c401b5cbaf5799c/sdktests/helpers.go#L137
  • Loading branch information
keelerm84 authored Dec 19, 2024
1 parent b60421a commit 14c03e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/data-files/server-side-eval/prerequisites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ evaluations:
flagKey: flag-with-prereq-cycle-at-top-level-1
context: { kind: "user", key: "user-key" }
expect:
value: false
value: null
reason: { "kind": "ERROR", "errorKind": "MALFORMED_FLAG" }

- name: prerequisite cycle is detected at deeper level, recursion stops
flagKey: flag-with-prereq-cycle-at-deeper-level-1
context: { kind: "user", key: "user-key" }
expect:
value: false
value: null
reason: { "kind": "ERROR", "errorKind": "MALFORMED_FLAG" }

- name: first prerequisite is a prerequisite of the second prerequisite
Expand Down

0 comments on commit 14c03e2

Please sign in to comment.