diff --git a/providers/openfeature-provider-flagd/openfeature/test-harness b/providers/openfeature-provider-flagd/openfeature/test-harness index b507289c..7575a1dc 160000 --- a/providers/openfeature-provider-flagd/openfeature/test-harness +++ b/providers/openfeature-provider-flagd/openfeature/test-harness @@ -1 +1 @@ -Subproject commit b507289c45fca9c2d312c7231929e5b95eae62bb +Subproject commit 7575a1dc45f176e57e809748a712a555e9aa5d11 diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py index 2e2db27a..dcec4adf 100644 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py +++ b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py @@ -409,9 +409,10 @@ def _resolve( # noqa: PLR0915 C901 flag_key=flag_key, context=context ) response = self.stub.ResolveObject(request, **call_args) - value = MessageToDict(response, preserving_proto_field_name=True)[ - "value" - ] + # DISABLED responses omit the value field entirely; fall back to default_value + value = MessageToDict(response, preserving_proto_field_name=True).get( + "value", default_value + ) elif flag_type == FlagType.FLOAT: request = evaluation_pb2.ResolveFloatRequest( flag_key=flag_key, context=context @@ -443,8 +444,12 @@ def _resolve( # noqa: PLR0915 C901 raise GeneralError(message) from e # When no default variant is configured, the server returns an empty/zero proto - # value with reason=DEFAULT. In that case, return the caller's code default value. - if response.reason == Reason.DEFAULT and not response.variant: + # value with reason=DEFAULT. For DISABLED flags the server omits the variant too. + # In both cases, return the caller's code default value. + if ( + response.reason in (Reason.DEFAULT, Reason.DISABLED) + and not response.variant + ): value = default_value # Got a valid flag and valid type. Return it.