From cc378063ec1aae612cc7bdb9c8ad5304cc6ac014 Mon Sep 17 00:00:00 2001 From: David Fahlander Date: Wed, 4 Sep 2024 23:30:15 +0200 Subject: [PATCH] Wrong call to updateTable.put() - it's inbound --- addons/dexie-cloud/src/yjs/applyYMessages.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/dexie-cloud/src/yjs/applyYMessages.ts b/addons/dexie-cloud/src/yjs/applyYMessages.ts index 7d98a93ff..47a01785f 100644 --- a/addons/dexie-cloud/src/yjs/applyYMessages.ts +++ b/addons/dexie-cloud/src/yjs/applyYMessages.ts @@ -23,7 +23,7 @@ export async function applyYServerMessages( let syncer = (await tx.table(utbl).get(DEXIE_CLOUD_SYNCER_ID)) as | YSyncer | undefined; - await tx.table(utbl).put(DEXIE_CLOUD_SYNCER_ID, { + await tx.table(utbl).put({ ...(syncer || { i: DEXIE_CLOUD_SYNCER_ID }), unsentFrom: Math.max(syncer?.unsentFrom || 1, m.i + 1), } as YSyncer);