(core) Fix bug in data engine when records are added after clearing a table with ReplaceTableData.

Summary:
It was manifesting as error "docactions.[Bulk]UpdateRecord for
non-existent record #1", and due to manualSort column having internal
state that wasn't properly cleared.

Test Plan: Added a test case that fails without the fix.

Reviewers: georgegevoian

Reviewed By: georgegevoian

Subscribers: georgegevoian

Differential Revision: https://phab.getgrist.com/D4183
This commit is contained in:
Dmitry S
2024-02-05 09:59:12 -05:00
parent fe2089710e
commit b64802dfe8
3 changed files with 57 additions and 3 deletions

View File

@@ -2824,9 +2824,12 @@ export async function onNewTab(action: () => Promise<void>) {
await driver.executeScript("window.open('about:blank', '_blank')");
const tabs = await driver.getAllWindowHandles();
await driver.switchTo().window(tabs[tabs.length - 1]);
await action();
await driver.close();
await driver.switchTo().window(tabs[tabs.length - 2]);
try {
await action();
} finally {
await driver.close();
await driver.switchTo().window(tabs[tabs.length - 2]);
}
}
/**