Skip to content

Commit

Permalink
fix(formula): skip tree after add to formula run list (#3114)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dushusir authored Aug 23, 2024
1 parent 5898e04 commit a238ea9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/services/snapshot/snapshot-transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export async function generateTemporarySnap(

// Trigger RPC and store the result in sheetBlocks.
if (worksheet.cellData) {
const sheetBlocks = splitCellDataToBlocks(worksheet.cellData, worksheet.rowCount!);
const sheetBlocks = splitCellDataToBlocks(worksheet.cellData, worksheet.columnCount!);
const responses = await Promise.all(
sheetBlocks.map((block) =>
snapshotService.saveSheetBlock(context, {
Expand Down Expand Up @@ -174,7 +174,7 @@ export async function transformWorkbookDataToSnapshot(

// Trigger RPC and store the result in sheetBlocks.
if (worksheet.cellData) {
const sheetBlocks = splitCellDataToBlocks(worksheet.cellData, worksheet.rowCount!);
const sheetBlocks = splitCellDataToBlocks(worksheet.cellData, worksheet.columnCount!);
const responses = await Promise.all(
sheetBlocks.map((block) =>
snapshotService.saveSheetBlock(context, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,9 @@ export class FormulaDependencyGenerator extends Disposable {

if (tree.isAdded()) {
formulaRunList.push(tree);
// If cacheStack is empty, that is, all parent nodes of the node have been processed, call setSkip() to mark the node as skipped. The premise of this is that the node should have been added to the formulaRunList, that is, the calculation is completed.
// Make sure setSkip is called after the node is added to formulaRunList to avoid skipping processing early.
tree.setSkip();
continue;
}

Expand Down

0 comments on commit a238ea9

Please sign in to comment.