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

Merged
merged 4 commits into from
Jun 12, 2024

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

github-actions bot commented May 13, 2024

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

Copy link

github-actions bot commented May 13, 2024

Deploy preview for docs ready!

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

Built with commit bd73bd8.
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
@jdorn jdorn merged commit eb28379 into main Jun 12, 2024
5 of 6 checks passed
@jdorn jdorn deleted the kc/fix-advanced-mongrule-operator-clobbering branch June 12, 2024 02:19
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