-
Notifications
You must be signed in to change notification settings - Fork 583
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
Caching Issue in Literals Dictionary Causes Valid Expression to Fail #614
Comments
this repo is no longer maintained. this issue will always stay open. please use a maintained fork, such as mine, to submit a new issue i did see that your issue was resolved? once a new version from zzzprojects is released then i will update my fork. i am adding this test to RulesEngine to support the future solution |
when i flip the two expressions the issue doesn't appear. maybe a temp solution? |
yeah, the issue is not showing up when you change the order because it is caching the first one. I opened the bug here because the Nuget is pointing to this repo, how are we managing the nuget versions? Do we have access to keep moving the Nuget from your fork? |
The Nuget solution will be an entirely new package. I am working on solving the many issues that exist before i release to Nuget. You can manually add the release from github until i release a Nuget solution? i am working on a possible solution (as i type this) while we wait on zzzprojects. |
the second expression works IF you use literal notation. i presented this exact solution in a previous issue you opened 583?
first one fails as expected and second one does not This 'may' be a caching issue with Sytem.Linq.Dynamic.Core, as you say. based on this discussion the issue is your use of literal notation. the second fails because the literal notation is not correct so it falls back on what was previously used. Note: 'falling back' is my educated guess as i have not looked at Ssytem.Linq.Dynamic.Core code to confirm this. |
I opened a PR there to fix this, that got merged to master today a few hours ago. They just need to release a new version. Not sure how you will do a workaround in this, cuz I checked the code and the expressions are created internally in the package |
This other bug you mentioned is not related to this one The 583 is evaluating the expression wrong because of fast compiler |
the other bug is a symptom of the same underlying issue, literal notation |
I don't think it is related man, the issue issue is related to the lib https://github.com/dadhi/FastExpressionCompiler We can talk about it in that thread and leave this one. Check out this line
Thats the problem with the fast compiler, thats why its not evaluating correctly. What do you think? |
as to that other issue, i have that solved in my fork. i pushed a nuget package RulesEngineEx |
Nice, curious on how you fixed it, do you have an PR? 😄 |
this project is dead at this location, the author stated so. he is no longer working for Microsoft and they have abandoned this project. further development is being done on my fork. |
this bug was resolved in the lib system.dynamic.linq.core in this PR: there's a new version of this package that got released, the rules engine got updated with this package and the tests are passing now. this was resolved in this fork: |
Description:
There is a bug in the Rules Engine's
RuleExpressionParser
where a valid expression fails due to a caching issue in the Literals dictionary in System.Linq.Dynamic.Core.Steps to Reproduce:
Board.NumberOfMembers = 0.2d
) throws an exception as expected due to a type mismatch.Board.NumberOfMembers = 0.2
) should be valid but throws an exception because the first expression is cached in the Literals dictionary.Test Code:
Expected Behavior:
The second expression (
Board.NumberOfMembers = 0.2
) should be evaluated correctly and not throw an exception.Actual Behavior:
The second expression throws an exception due to the first expression being cached in the Literals dictionary.
Potential Cause:
The caching mechanism in the Literals dictionary in System.Linq.Dynamic.Core does not handle different numeric literal types correctly, leading to invalid caching of expressions.
The text was updated successfully, but these errors were encountered: