fix(workspace): avoid data loss (hot-fix) (#6114)

This commit is contained in:
EYHN
2024-03-14 13:14:03 +08:00
committed by GitHub
parent 39476d16ef
commit cccea3ec3e
2 changed files with 10 additions and 0 deletions
@@ -19,6 +19,13 @@ export function createSQLiteStorage(workspaceId: string): SyncStorage {
);
if (update) {
if (
update.byteLength === 0 ||
(update.byteLength === 2 && update[0] === 0 && update[1] === 0)
) {
return null;
}
return {
data: update,
state: encodeStateVectorFromUpdate(update),