Skip to content

EvaluationContext attributes key collision #40

@thomaspoignant

Description

@thomaspoignant

In the EvaluationContext we are storing all the attributes in different Map based on the type of the data.

private final Map<String, Integer> integerAttributes;
private final Map<String, String> stringAttributes;
private final Map<String, Boolean> booleanAttributes;
final Map<String, String> jsonAttributes;

With this implementation, it means that we can have multiple attributes with the same key name if they have different types.

It means that I can do something like this:

ctx.addStringAttribute("key1","value);
ctx.addIntegerAttribute("key1",value);

Since most of the providers are using JSON or any structured key-value layer to send the data to the backend I wonder if it will not cause problems to have multiple times the same key.

For example in go-feature-flag this is an issue because we are calling a rest API with a JSON body and we will override one of the keys when creating the JSON Object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions