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

Fix operator precedence in advanced attribute targeting #2516

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Kevin-Chant
Copy link
Contributor

Features and Changes

Currently due to the use of in, a single special operator (or/nor/and/not) in a nested ConditionInterface will ignore all other keys at that level. From the mongo docs it looks like we should be allowing multiple keys on a single level, even with operators like $or.

Testing

  1. Create a feature with an advanced targeting rule that has at least one $or (or other special operator) and at least one other operator, both at the top level.
  2. Set up attributes such that the $or condition passes, but the other condition fails
  3. Observe that the user is still exposed to the experiment without this change, but is no longer exposed with it

Screenshots

Experiment setup:
image

Importing from npm package (no fix)

image

Importing from local package (with fix)

image
image

Copy link

Your preview environment pr-2516-bttf has been deployed.

Preview environment endpoints are available at:

Copy link

github-actions bot commented May 13, 2024

Deploy preview for docs ready!

✅ Preview
https://docs-pw3bacjwf-growthbook.vercel.app

Built with commit efea191.
This pull request is being automatically deployed with vercel-action

@Kevin-Chant Kevin-Chant requested a review from jdorn May 13, 2024 23:41
@Kevin-Chant Kevin-Chant assigned jdorn and unassigned jdorn May 13, 2024
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 this pull request may close these issues.

None yet

2 participants