mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Fix another cause of inconsistency that can be triggered by bad DocActions.
Summary: An incorrect DocAction (as possible from an Undo of a non-last action) could cause RemoveRecord on an already missing record. This used to create an invalid undo, and wreak havoc when a series of DocActions later fails and needs to be reverted. To fix, consider RemoveRecord of a missing record to be a no-op. Test Plan: Includes a new test case that triggers the problem. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2717
This commit is contained in:
@@ -434,7 +434,8 @@ class Engine(object):
|
||||
collist = sorted(actions.transpose_bulk_action(meta_columns),
|
||||
key=lambda c: (c.parentId, c.parentPos))
|
||||
raise AssertionError("Internal schema inconsistent; extra columns in metadata:\n"
|
||||
+ "\n".join(' ' + str(schema.SchemaColumn(c.colId, c.type, bool(c.isFormula), c.formula))
|
||||
+ "\n".join(' #%s %s' %
|
||||
(c.id, schema.SchemaColumn(c.colId, c.type, bool(c.isFormula), c.formula))
|
||||
for c in collist if c.parentId not in valid_table_refs))
|
||||
|
||||
def dump_state(self):
|
||||
|
||||
Reference in New Issue
Block a user