Skip to content

Commit eb41c48

Browse files
committed
feat(flagd): RPC resolver substitutes caller default on reason=DISABLED
Mirrors the existing reason=DEFAULT substitution: when the server returns an empty variant alongside DISABLED, surface the caller's code default value rather than the zero proto value. Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
1 parent 26b9e2b commit eb41c48

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers

providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,9 @@ def _resolve( # noqa: PLR0915 C901
430430
raise GeneralError(message) from e
431431

432432
# When no default variant is configured, the server returns an empty/zero proto
433-
# value with reason=DEFAULT. In that case, return the caller's code default value.
434-
if response.reason == Reason.DEFAULT and not response.variant:
433+
# value with reason=DEFAULT. For DISABLED flags the server omits the variant too.
434+
# In both cases, return the caller's code default value.
435+
if response.reason in (Reason.DEFAULT, Reason.DISABLED) and not response.variant:
435436
value = default_value
436437

437438
# Got a valid flag and valid type. Return it.

0 commit comments

Comments
 (0)