Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(sheets-table): keep super table mutations local (#7344)

Univerac9ac0e1d58f
diff --git a/packages/sheets-table/src/controllers/__tests__/sheet-table-formula.controller.spec.ts b/packages/sheets-table/src/controllers/__tests__/sheet-table-formula.controller.spec.ts
index fae030ae1c..a049e38caf 100644
--- a/packages/sheets-table/src/controllers/__tests__/sheet-table-formula.controller.spec.ts
+++ b/packages/sheets-table/src/controllers/__tests__/sheet-table-formula.controller.spec.ts
@@ -60,7 +60,7 @@ describe('SheetTableFormulaController', () => {
sheetId: 's1',
range: { startRow: 0, endRow: 5, startColumn: 0, endColumn: 2 },
}),
- }));
+ }), { onlyLocal: true });
const titleMap = executeCommand.mock.calls[0][1].reference.titleMap as Map<string, number>;
expect(titleMap.get('id')).toBe(0);
@@ -73,7 +73,7 @@ describe('SheetTableFormulaController', () => {
expect(executeCommand).toHaveBeenNthCalledWith(3, RemoveSuperTableMutation.id, {
unitId: 'u1',
tableName: 'Orders_Old',
- });
+ }, { onlyLocal: true });
expect(executeCommand).toHaveBeenCalledTimes(4);
tableDelete$.next({
@@ -89,7 +89,8 @@ describe('SheetTableFormulaController', () => {
sheetId: 's1',
range: { startRow: 0, endRow: 5, startColumn: 0, endColumn: 2 },
},
- });
+ }, { onlyLocal: true });
+ expect(executeCommand.mock.calls.every((call) => call[2]?.onlyLocal === true)).toBe(true);
controller.dispose();
});
diff --git a/packages/sheets-table/src/controllers/sheet-table-formula.controller.ts b/packages/sheets-table/src/controllers/sheet-table-formula.controller.ts
index 621e8fc734..10997d35d8 100644
--- a/packages/sheets-table/src/controllers/sheet-table-formula.controller.ts
+++ b/packages/sheets-table/src/controllers/sheet-table-formula.controller.ts
@@ -60,7 +60,7 @@ export class SheetTableFormulaController extends Disposable {
sheetId: subUnitId,
range,
},
- });
+ }, { onlyLocal: true });
})
);
this.disposeWithMe(
@@ -70,7 +70,7 @@ export class SheetTableFormulaController extends Disposable {
this._commandService.executeCommand<ISetSuperTableMutationSearchParam>(RemoveSuperTableMutation.id, {
unitId,
tableName: oldTableName,
- });
+ }, { onlyLocal: true });
const table = this._tableManager.getTableById(unitId, tableId);
if (!table) {
@@ -98,6 +98,6 @@ export class SheetTableFormulaController extends Disposable {
sheetId: tableInfo.subUnitId,
titleMap,
},
- });
+ }, { onlyLocal: true });
}
}