(core) Change array.reverse() in GranularAccess to avoid accidental in-place reversal.

Test Plan: Added a test case to tickle the bug this was causing.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2718
pull/3/head
Dmitry S 3 years ago
parent ec023a3ba6
commit 7c81cf2368

@ -642,8 +642,8 @@ export class GranularAccess {
// TODO: this would need to be elaborated to work well on bundles containing table
// renames.
const tableId = getTableId(rowsBefore);
for (const snapshots of allRowSnapshots.reverse()) {
const rowsAfter = snapshots[1];
for (let i = allRowSnapshots.length - 1; i >= 0; i--) {
const rowsAfter = allRowSnapshots[i][1];
if (getTableId(rowsAfter) === tableId) {
return {rowsBefore, rowsAfter};
}

Loading…
Cancel
Save