feat: be more lenient on sync
This commit is contained in:
@@ -81,6 +81,7 @@ export async function pullChanges(): Promise<void> {
|
||||
};
|
||||
|
||||
for (const change of changes) {
|
||||
try {
|
||||
const data = typeof change.payload === 'string'
|
||||
? JSON.parse(change.payload)
|
||||
: change.payload;
|
||||
@@ -89,6 +90,9 @@ export async function pullChanges(): Promise<void> {
|
||||
} else {
|
||||
await applyUpsert(change.entity, data);
|
||||
}
|
||||
} catch {
|
||||
// Skip malformed change; will not block remaining changes.
|
||||
}
|
||||
}
|
||||
await setLastVersion(server_version);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user