core: handle unknown collection types in sync (#9878)

Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
01zulfi
2026-05-19 13:38:20 +05:00
committed by GitHub
parent 8f8ac25d20
commit 4dcf14fce1

View File

@@ -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<Item> | undefined)[] = [];