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