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

Returns match: true but doesn't evaluate to a value #63

Closed
andreyvital opened this issue May 11, 2019 · 4 comments · Fixed by #65
Closed

Returns match: true but doesn't evaluate to a value #63

andreyvital opened this issue May 11, 2019 · 4 comments · Fixed by #65
Assignees
Labels

Comments

@andreyvital
Copy link

I think i've stumble upon another issue...so here's what I did:

  • Created a rule test;
  • Created a segment test with a constraint: @alwaysMatch IS NOT PRESENT
  • Added two variants to test (on, off);
  • Modified the targeting of test to be 50% off, 50% on;
  • Deleted the two variants individually, created 5 new ones (a, b, c, d, e)—deleted the previous targeting and added a new one, whereas a gets 50% and b, c, d, e gets 10% respectively.

Issue:

{
    "requestId": "1e5aae90-4ea3-4311-be85-91d0d24ca3e4",
    "entityId": "3",
    "requestContext": {},
    "match": true,
    "flagKey": "test",
    "segmentKey": "test",
    "timestamp": "2019-05-11T18:22:53.517088460Z",
    "requestDurationMillis": 0.980012
}

I've tested programatically with 100 different IDs, for some reason, it doesn't evaluate to anything with some of them.

State of the world:

sqlite> .tables
constraints        flags              schema_migrations  variants
distributions      rules              segments

sqlite> select * from flags;
test|test||1|2019-05-11 18:09:34.824808692+00:00|2019-05-11 18:09:34.824808692+00:00

sqlite> select * from rules;
09a3cee0-448a-4100-8d55-b2a68df41eae|test|test|1|2019-05-11 18:22:02.831441605+00:00|2019-05-11 18:22:02.831441605+00:00

sqlite> select * from segments;
test|test||2019-05-11 18:09:39.674672314+00:00|2019-05-11 18:09:39.674672314+00:00

sqlite> select * from distributions;
fe817dd0-fc27-4d30-b0d5-ccd4ea0a3282|09a3cee0-448a-4100-8d55-b2a68df41eae|af3c2070-9692-40b7-9258-608c24a53b8d|50.0|2019-05-11 18:22:02.842112509+00:00|2019-05-11 18:22:02.842112509+00:00
ee4743af-c6fc-4523-b38a-03c1713b7d1b|09a3cee0-448a-4100-8d55-b2a68df41eae|d7049aa6-9906-4e9d-b6e5-9a9be424992a|10.0|2019-05-11 18:22:02.846632236+00:00|2019-05-11 18:22:02.846632236+00:00
c43b7cb4-0c19-4e12-811d-2f4c774cc506|09a3cee0-448a-4100-8d55-b2a68df41eae|e019aff0-df11-40da-878d-5b4293c69f15|10.0|2019-05-11 18:22:02.846011664+00:00|2019-05-11 18:22:02.846011664+00:00
0c4e8daf-9f34-4691-9e6f-23c3a801ff10|09a3cee0-448a-4100-8d55-b2a68df41eae|8fce46af-045b-4b34-a4bb-c362585908f4|10.0|2019-05-11 18:22:02.842992967+00:00|2019-05-11 18:22:02.842992967+00:00
e4072afe-0959-4ab0-970c-106f6ef9754a|09a3cee0-448a-4100-8d55-b2a68df41eae|59e512a4-f486-4b4c-9857-28e4e759fa1d|10.0|2019-05-11 18:22:02.844072062+00:00|2019-05-11 18:22:02.844072062+00:00

sqlite> select * from variants;
af3c2070-9692-40b7-9258-608c24a53b8d|test|a|a||2019-05-11 18:21:28.402943187+00:00|2019-05-11 18:21:28.402943187+00:00
8fce46af-045b-4b34-a4bb-c362585908f4|test|b|b||2019-05-11 18:21:32.100555715+00:00|2019-05-11 18:21:32.100555715+00:00
59e512a4-f486-4b4c-9857-28e4e759fa1d|test|c|c||2019-05-11 18:21:34.568535072+00:00|2019-05-11 18:21:34.568535072+00:00
e019aff0-df11-40da-878d-5b4293c69f15|test|d|d||2019-05-11 18:21:37.8885922+00:00|2019-05-11 18:21:37.8885922+00:00
d7049aa6-9906-4e9d-b6e5-9a9be424992a|test|e|e||2019-05-11 18:21:41.021846003+00:00|2019-05-11 18:21:41.021846003+00:00
@andreyvital
Copy link
Author

Here's the db:
flipt.db.zip

@markphelps markphelps added the bug label May 11, 2019
@markphelps markphelps added this to the 1.0.0 milestone May 11, 2019
@markphelps
Copy link
Collaborator

Thank you for the detailed bug report (and the db export). I'll take a look at this one before #60 as this one doesn't seem to have a work around.

@markphelps markphelps self-assigned this May 11, 2019
@markphelps
Copy link
Collaborator

Yup, I found some issues in my evaluation logic. Writing some tests cases and hope to have a fix out tomorrow.

@markphelps
Copy link
Collaborator

Ok, this should be fixed in the latest release: https:/markphelps/flipt/releases/tag/v0.4.1

Please let me know if you run into any more issues. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants