From 4dcf14fce1c428ea64b4b8ff33b9b72b2c76a5b8 Mon Sep 17 00:00:00 2001 From: 01zulfi <85733202+01zulfi@users.noreply.github.com> Date: Tue, 19 May 2026 13:38:20 +0500 Subject: [PATCH] core: handle unknown collection types in sync (#9878) Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com> --- packages/core/src/api/sync/index.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/core/src/api/sync/index.ts b/packages/core/src/api/sync/index.ts index d0fef7eec..aec8fb1ea 100644 --- a/packages/core/src/api/sync/index.ts +++ b/packages/core/src/api/sync/index.ts @@ -400,6 +400,16 @@ export class Sync { } const collectionType = SYNC_COLLECTIONS_MAP[itemType]; + + if (!collectionType) { + this.logger.error( + new Error( + `Unknown collection type for item type ${itemType}. Skipping chunk.` + ) + ); + return; + } + const collection = this.db[collectionType].collection; const localItems = await collection.records(chunk.items.map((i) => i.id)); let items: (MaybeDeletedItem | undefined)[] = [];