From c302425a057a2d4de01430dad0aa0eca660e35e2 Mon Sep 17 00:00:00 2001 From: DarkSky <25152247+darkskygit@users.noreply.github.com> Date: Sat, 15 Nov 2025 03:19:51 +0800 Subject: [PATCH] fix(server): doc squash timeout (#13939) --- packages/backend/server/src/core/doc/storage/doc.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/backend/server/src/core/doc/storage/doc.ts b/packages/backend/server/src/core/doc/storage/doc.ts index 65f7f0a1d..ca9ff0ae1 100644 --- a/packages/backend/server/src/core/doc/storage/doc.ts +++ b/packages/backend/server/src/core/doc/storage/doc.ts @@ -79,11 +79,15 @@ export abstract class DocStorageAdapter extends Connection { const updates = await this.getDocUpdates(spaceId, docId); if (updates.length) { + const docUpdate = await this.squash( + snapshot ? [snapshot, ...updates] : updates + ); return await this.squashUpdatesToSnapshot( spaceId, docId, updates, - snapshot + snapshot, + docUpdate ); } @@ -95,15 +99,14 @@ export abstract class DocStorageAdapter extends Connection { spaceId: string, docId: string, updates: DocUpdate[], - snapshot: DocRecord | null + snapshot: DocRecord | null, + finalUpdate: DocUpdate ) { this.logger.log( `Squashing updates, spaceId: ${spaceId}, docId: ${docId}, updates: ${updates.length}` ); - const { timestamp, bin, editor } = await this.squash( - snapshot ? [snapshot, ...updates] : updates - ); + const { bin, timestamp, editor } = finalUpdate; const newSnapshot: DocRecord = { spaceId, docId,