diff --git a/apps/server/src/modules/tldraw/service/tldraw.ws.service.ts b/apps/server/src/modules/tldraw/service/tldraw.ws.service.ts index 60d69193695..42754345b6a 100644 --- a/apps/server/src/modules/tldraw/service/tldraw.ws.service.ts +++ b/apps/server/src/modules/tldraw/service/tldraw.ws.service.ts @@ -9,7 +9,7 @@ import { readSyncMessage, writeSyncStep1, writeUpdate } from 'y-protocols/sync'; import { TldrawBoardRepo } from '@src/modules/tldraw/repo'; import { Buffer } from 'node:buffer'; import { getDocUpdatesFromQueue, pushDocUpdatesToQueue } from '@src/modules/tldraw/redis'; -import { applyUpdate, Doc } from 'yjs'; +import { applyUpdate, Doc, encodeStateAsUpdate } from 'yjs'; import { Redis } from 'ioredis'; @Injectable() @@ -176,6 +176,8 @@ export class TldrawWsService { } }); + applyUpdate(doc, encodeStateAsUpdate(redisYDoc)); + // Check if connection is still alive let pongReceived = true; const pingInterval = setInterval(() => {