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

[Feature] Consider exposing TargetingKey with all value exporters #801

Closed
Kavindu-Dodan opened this issue Feb 12, 2024 · 0 comments · Fixed by #805
Closed

[Feature] Consider exposing TargetingKey with all value exporters #801

Kavindu-Dodan opened this issue Feb 12, 2024 · 0 comments · Fixed by #805
Assignees

Comments

@Kavindu-Dodan
Copy link
Contributor

Consider ImmutableStructure.asMap() 1 or ImmutableStructure. asObjectMap() 2 methods. These expose the attributes but they do not include the targeting key 3.

This could lead to unexpected behaviors where evaluations miss targeting key if provider authors overlook the implementation details (see 4). In contrast, go-sdk perform a context flattening to include targeting key 5 and js-sdk context is a record hence this issue does not exist in them.

AC

If agreed, we should include the targeting key in bulk exporters (ex:- ctx.asObject) as well as improve overall context handling by documentation improvements

Footnotes

  1. https://github.com/open-feature/java-sdk/blob/v1.7.3/src/main/java/dev/openfeature/sdk/MutableStructure.java#L90

  2. https://github.com/open-feature/java-sdk/blob/v1.7.3/src/main/java/dev/openfeature/sdk/AbstractStructure.java#L25

  3. https://github.com/open-feature/java-sdk/blob/v1.7.3/src/main/java/dev/openfeature/sdk/ImmutableContext.java#L21

  4. https://github.com/open-feature/java-sdk-contrib/pull/676

  5. https://github.com/open-feature/go-sdk/blob/main/openfeature/client.go#L687-L695

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant