From 1bff5095f687752be591020bc74e8ea18408c35f Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins Date: Tue, 19 Dec 2023 19:25:21 +0000 Subject: [PATCH] :bug: (nYnab) fix call-stack-exceeded error with fallback solution Closes #1968 --- packages/loot-core/src/server/spreadsheet/spreadsheet.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/loot-core/src/server/spreadsheet/spreadsheet.ts b/packages/loot-core/src/server/spreadsheet/spreadsheet.ts index bdb57348057..b4ca535c967 100644 --- a/packages/loot-core/src/server/spreadsheet/spreadsheet.ts +++ b/packages/loot-core/src/server/spreadsheet/spreadsheet.ts @@ -113,7 +113,12 @@ export default class Spreadsheet { const cells = this.dirtyCells; this.dirtyCells = []; - this.queueComputation(this.graph.topologicalSort(cells)); + try { + this.queueComputation(this.graph.topologicalSort(cells)); + } catch (e) { + console.error('Failed sorting cells. Falling back to unsorted list.'); + this.queueComputation(cells); + } } return [];