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
feat: add specifications for new operators #25
Conversation
The specifications runs green in the node SDK implementation of them 🔥 (PR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value/values needs to stay a string
{ | ||
"contextName": "currentTime", | ||
"operator": "DATE_AFTER", | ||
"value": "2022-01-29T13:00:00.000Z" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably a minor thing but! Should DATE_BEFORE
and DATE_AFTER
be inclusive (i.e. LT versus LTE)?
I don't see this being a huge issue (there's a vanishingly small chance people will notice) but figured I'd ask as long as I was writing unit tests. In the Python client, it's currently coded to be inclusive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The meaning of the word "AFTER" seems to be closer to GT.
For this reason I think we should require it to be exclusive.
I'm missing some edge cases for versions, like 1.2.3-beta being lower than 1.2.3 and greater than 1.2.3-alpha. |
Good catch @RikudouSage - they are indeed missing, and we should add those as well :) |
I think we are close to a an agreeable state on the specs. Would be good to get feedback from
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good now :)
Updated spec tests in Unleash/unleash-client-python#192 and everything looks good. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, updated to latest version in Unleash/unleash-client-php#47 and everything works.
I understand that this feedback might be a bit late, as the spec seems to be closed now, but I thought it was still worth giving my 2 cents. |
This doesn't make much sense IMO, since the current time would need to be the same down to exactly seconds (or milliseconds, microseconds, whatever your implementation takes into consideration). |
@RikudouSage Given that How do you represent the from 1pm and on for a given date? using
If you want to include "2022-01-29T13:00:00.000Z" as well, then you could set |
I understand your concern regarding "exactly" equals time, but It should be safe to assume that non defined precisions are floored down to zero. |
We constantly should add more edge cases as we discover them. As long as the correct behavior is possible to document and within the agreed protocol any deviation should be considered as a bug in the respective SDKs.
Maybe, we can add these later.
These date operators where on purpose given a different name, just because they are "less accurate". The chances of a date-time to be equal on a sub-second level is quite small, and only adds additional options the user needs to consider. For DATE operators I do not worry much about micro-precision. If you have the need to be precise on this level you probably also worry about time-synchronization between servers and would probably not rely on any third part tool for your business logic. |
No description provided.