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

Implement IN keyword for local evaluation #124

Closed
1 task
khvn26 opened this issue Jul 5, 2023 · 1 comment
Closed
1 task

Implement IN keyword for local evaluation #124

khvn26 opened this issue Jul 5, 2023 · 1 comment
Assignees

Comments

@khvn26
Copy link
Member

khvn26 commented Jul 5, 2023

Part of Flagsmith/flagsmith#1595.

NodeJS client's local evaluation mode has to support the IN keyword for segments.

Refer to the Python engine implementation: https://github.com/Flagsmith/flagsmith-engine/blob/4cfb30792feb1fe9f64c082af7e9d64fc1a2f451/flag_engine/segments/models.py#L75-L80

Acceptance Criteria

  • When initialized with local evaluation, Flagsmith client correctly evaluates segments defined with the IN keyword.
@novakzaballa
Copy link
Contributor

Tested by creating a segment called "Colors", and adding a condition using the IN keyword as shown below:

Image

In ff_segment flag the value is "segment" and was created a segment override with the "Colors" segment

Image

I used an identity named "user1" and added a new trait {color: "red"}. Also, the value of ff_segment in its segments was changed to "value".

Image

Created an application in Node.js to test the result of getIdentityFlags and check if it is correct, the value obtained when using the getEnvironmentFlags method was also tested.

The results are shown below the following image.

Image

Here you can see that the value of ff_segment is "value"

Image

Here you can see that the value of ff_segment is "segment"

Image

The results are correct in both cases.

In conclusion, the IN keyword seems to be working as expected, and no need for changes was detected.

@khvn26 khvn26 closed this as completed Jul 20, 2023
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

No branches or pull requests

2 participants