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: Complex jexl issues #2356

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

winged
Copy link
Contributor

@winged winged commented Jan 14, 2025

Working PR - currently only contains demonstrations of some issues we found. We will use this as a basis for validating a rewrite of the form structure / jexl evaluation code.

@winged winged force-pushed the complex_jexl_issues branch from 36d03b3 to ecdec4f Compare January 24, 2025 13:31
winged and others added 5 commits January 24, 2025 14:32
Table rows were sorted, but backwards; questions were not sorted at all,
and thus might have lead to unpredictable behaviour. We noe explicitly
sort this correctly, therefore making things a bit more testable.
Calculated questions do not work correctly when located inside a table row:
The recalculation is currently triggered on the root document, which will
only find one of the rows, and update that - while likely ignoring the row
where the actual dependency is located.

This test is intended to demonstrate the problem, and thus will currently
fail.
@winged winged force-pushed the complex_jexl_issues branch from ecdec4f to 54e63bd Compare January 24, 2025 13:32
The new structure / jexl evaluator works a bit differently: Instead of
trying to replace evaluation contexts during recursive evaluation (for
example is_hidden checks), we now have a local JEXL runtime for each
field. Also, the JEXL expressions (or their results, rather) are heavily
cached and should speed things up significantly.

Note this is WIP, many tests are still failing, but many are already
succeeding as well.

We're trying to keep the test cases 100% unchanged - the only
modifications currently are some improved assertion messages, so
debugging becomes easier.
@winged winged force-pushed the complex_jexl_issues branch from 54e63bd to 2007067 Compare January 24, 2025 14:56
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.

2 participants