Skip to content
New issue

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

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

Already on GitHub? # to your account

[BUG] Warning about overwriting $flagd property when perform bulk evaluation #923

Closed
beeme1mr opened this issue Sep 19, 2023 · 2 comments · Fixed by #924
Closed

[BUG] Warning about overwriting $flagd property when perform bulk evaluation #923

beeme1mr opened this issue Sep 19, 2023 · 2 comments · Fixed by #924
Labels
bug Something isn't working Needs Triage This issue needs to be investigated by a maintainer

Comments

@beeme1mr
Copy link
Member

Observed behavior

A warning is logged to the console for every feature flag with a targeting rule defined when performing a bulk evaluation. This only affects the ResolveAll endpoint.

Here's an output of the logs.

playground-flagd-1            | 2023-09-19T00:56:01.691Z        warn    eval/json_evaluator.go:366      overwriting $flagd properties in the context    {"component": "evaluator", "evaluator": "json"

Expected Behavior

The warning log should only occur when the incoming context includes the property $flagd.

Steps to reproduce

Start the latest version of flagd. In this example, the test bed image is used but the same behavior is visible in flagd as well.

docker run --rm -it -p 8013:8013 ghcr.io/open-feature/flagd-testbed:latest

Run the ResolveAll command

curl -X POST "http://localhost:8013/schema.v1.Service/ResolveAll" \
  -d '{"context":{}}' -H "Content-Type: application/json"
@beeme1mr beeme1mr added bug Something isn't working Needs Triage This issue needs to be investigated by a maintainer labels Sep 19, 2023
@beeme1mr
Copy link
Member Author

@craigpastro
Copy link
Member

Oh my. I guess this is probably because maps are passed as reference, and we are adding the $flagd properties to the map which then is found in all the references. Probably setFlagdProperties should return a new map?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working Needs Triage This issue needs to be investigated by a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants