gristlabs_grist-core/sandbox
Alex Hall 5258fa649d (core) Fix self-updating trigger formulas used in lookups
Summary:
The problem: For a data-cleaning column (one that depends on itself) `doBulkUpdateRecord` calls `prevent_recalc(should_prevent=False)``
which is supposed to cause it to get calculated eventually.
But before that it calls `_do_doc_action` -> `apply_doc_action` -> `_bring_lookups_up_to_date` which recalculates
a lookup column which eventually calls `_recompute_step(allow_evaluation=False)` on the data-cleaning column
which shouldn't really do anything significant but it both modifies the set `self.recompute_map[node]`
and then removes it from the map after it's empty.

The solution: when `allow_evaluation=False` and `self._prevent_recompute_map[node]` is nonempty,
ensure `self.recompute_map[node]` is not modified,
and check the map directly (instead of `dirty_rows` which can now be separate) to see if the set is empty before cleanup.

Test Plan: Added a lookup column to test_self_trigger, ensured that this caused the test to fail without the other two changes in engine.py.

Reviewers: paulfitz

Reviewed By: paulfitz

Subscribers: dsagal

Differential Revision: https://phab.getgrist.com/D3006
2021-08-31 00:28:41 +02:00
..
docker (core) support python3 in grist-core, and running engine via docker and/or gvisor 2021-07-28 09:02:32 -04:00
grist (core) Fix self-updating trigger formulas used in lookups 2021-08-31 00:28:41 +02:00
gen_js_schema.py (core) Remove help, mkdocs, and the 'env' virtualenv 2021-06-30 16:59:08 +02:00
install_tz.js (core) move data engine code to core 2020-07-29 08:57:25 -04:00
requirements3.txt (core) support python3 in grist-core, and running engine via docker and/or gvisor 2021-07-28 09:02:32 -04:00
requirements.txt (core) support python3 in grist-core, and running engine via docker and/or gvisor 2021-07-28 09:02:32 -04:00