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 over-eager caching of Now variable #191

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

jchadwick-buf
Copy link
Member

Closes #185.

I gave a shot at making tests for this, but it's less trivial than it seems at first glance. I manually confirmed this fixes the bug for now.

To explain what's going on here, you have to recognize that newRulesVariable is used during constraint compilation (for constant folding) and newThisVariable is used during the actual activation. We don't want now to get constant-folded, so we should make sure it is only defined at evaluation time, not before. I think this was most likely switched on accident and probably also means that the now variable was not working in custom constraints.

@jchadwick-buf jchadwick-buf requested a review from jhump October 3, 2024 14:56
@jchadwick-buf jchadwick-buf merged commit 26dfd7f into main Oct 3, 2024
4 checks passed
@jchadwick-buf jchadwick-buf deleted the jchadwick/now-variable-fix branch October 3, 2024 15:32
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.

[BUG] Validation of timestamp fields fails on repeated calls to validate().
2 participants