Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata is getting lost #281

Closed
askpt opened this issue Jul 25, 2024 Discussed in #280 · 0 comments · Fixed by #282
Closed

Metadata is getting lost #281

askpt opened this issue Jul 25, 2024 Discussed in #280 · 0 comments · Fixed by #282
Assignees
Labels
bug Something isn't working

Comments

@askpt
Copy link
Member

askpt commented Jul 25, 2024

Discussed in #280

Originally posted by apatenge July 24, 2024
Hi OpenFeature .NET team,

I am wondering if there is a bug in the handling of the meta data between the resolver and the feature client interface.

I have created an own provider for my system and when I handover the metadata to the ResolutionDetails in the resolver it disappears on the way to the feature client.

I guess I found the reason for it. In the ResolutionDetailsExtensions the meta data is not passed through. It seems it is forgotten be added to the parameters of the FlagEvaluationDetails there.

See here: https://github.com/open-feature/dotnet-sdk/blob/main/src/OpenFeature/Extension/ResolutionDetailsExtensions.cs

I got me the source code of the latest release 1.5.1 and changed it as the following:

From:
return new FlagEvaluationDetails<T>(details.FlagKey, details.Value, details.ErrorType, details.Reason, details.Variant, details.ErrorMessage);

To:
return new FlagEvaluationDetails<T>(details.FlagKey, details.Value, details.ErrorType, details.Reason, details.Variant, details.ErrorMessage, details.FlagMetadata);

With that change it seems to work properly.

Could you please check for this and prove my change? Maybe I am wrong and my way to use it is wrong.

If not and this is correct, would there be a possibility to release a new version (1.5.2 ?!) with that change and provide this as Nuget package?

I would like to use the official package instead of my custom version.

Many thanks.

Regards,
André

@askpt askpt added the bug Something isn't working label Jul 25, 2024
@askpt askpt self-assigned this Jul 25, 2024
toddbaert pushed a commit that referenced this issue Jul 26, 2024
…tails to FlagEvaluationDetails (#285)

## This PR

When converting the ResolutionDetails to FlagEvalutionDetails we aren't
passing the FlagMetadata to the new object.

### Related Issues

Fixes [#1234523](#281)

### Notes
This PR is done on a common merge base so we can merge it into v1 as
well

### Follow-up Tasks
N/A

### How to test
Unit test added to covert the missing test case

---------

Signed-off-by: Benjamin Evenson <2031163+benjiro@users.noreply.github.com>
toddbaert pushed a commit that referenced this issue Jul 26, 2024
…agEvaluationDetails (#282)

## This PR

When converting the ResolutionDetails to FlagEvalutionDetails we aren't
passing the ImmutableMetadata to the new object.

### Related Issues

Fixes [#281](#281)

### Notes
This PR is done on a common merge base so we can merge it into v1 as
well

### Follow-up Tasks
N/A

### How to test
Unit test added to covert the missing test case

---------

Signed-off-by: Benjamin Evenson <2031163+benjiro@users.noreply.github.com>
Co-authored-by: André Silva <2493377+askpt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant