gristlabs_grist-core/sandbox
Alex Hall 9b36fb4dab (core) Fix error in sandbox when removing multiple summary source columns
Summary:
Fixes a very specific bug reported here: https://grist.slack.com/archives/C069RUP71/p1694630242765769

The error occurred when:

1. Removing multiple columns simultaneously
2. Those columns were sources of groupby columns for a summary table (so removing them meant recreating the summary table and thus deleting its columns)
3. There was a display column for one of the columns that got deleted (either directly or indirectly) which was set to be automatically removed since it was no longer needed, but this failed because the column was already deleted as part of earlier table removal.

I fixed this by making `apply_auto_removes` remove table records last, so removing the display column wouldn't be a problem.

That fixed the original error, but then I noticed that trying to undo the removal could lead to another error (under even more specific circumstances). It's hard to see exactly why, but I can see that just 3 `RemoveColumn` user actions generated over 100 doc actions and corresponding undo actions, hence the difficulty in narrowing the problem down. This is partly because removing a single column would recreate a summary table, only for that table to be immediately replaced again when another column was removed. Making the frontend send a single `[BulkRemoveRecord, _grist_Tables_column, ...] ` leads to a more efficient and sensible process with about half as many doc actions and no undo error. I think this alone would also solve the original error, but the data engine change seems more generally helpful and worth keeping.

Test Plan: Added a Python test and an nbrowser test

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D4052
2023-09-27 16:23:49 +02:00
..
docker (core) Upgrade to Python 3.11 2023-08-04 18:19:40 +02:00
grist (core) Fix error in sandbox when removing multiple summary source columns 2023-09-27 16:23:49 +02:00
gvisor (core) Upgrade to Python 3.11 2023-08-04 18:19:40 +02:00
pyodide remove cached packages for pyodide when cleaning up (#650) 2023-08-29 15:21:34 -04:00
bundle_as_wheel.sh support other SQLite wrappers, and various hooks needed by grist-static (#516) 2023-05-23 15:17:28 -04:00
gen_js_schema.py add a script for copying schema information from python to typescript 2023-01-17 15:54:41 -05:00
install_tz.js (core) apply some dependabot suggestions 2022-09-07 14:15:34 -04:00
MANIFEST.in support other SQLite wrappers, and various hooks needed by grist-static (#516) 2023-05-23 15:17:28 -04:00
requirements3.in (core) Upgrade to Python 3.11 2023-08-04 18:19:40 +02:00
requirements3.txt (core) Fix updating attributes inside f-strings when columns are renamed 2023-09-11 14:41:30 +02:00
requirements.txt (core) Fix updating attributes inside f-strings when columns are renamed 2023-09-11 14:41:30 +02:00
run.sh (core) add machinery for self-managed flavor of Grist 2022-05-12 12:39:52 -04:00
setup.py support other SQLite wrappers, and various hooks needed by grist-static (#516) 2023-05-23 15:17:28 -04:00
watch.sh Add command to debug the server (#533) 2023-06-20 12:49:57 -04:00