Skip to content

Commit f1a5d1d

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 6acf7e9 commit f1a5d1d

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
@@ -443,8 +443,9 @@ def _resolve( # noqa: PLR0915 C901
443443
raise GeneralError(message) from e
444444

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

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

0 commit comments

Comments
 (0)