mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 05:14:54 +00:00
fix(core): incorrect blocksuite data format (#4039)
This commit is contained in:
@@ -50,9 +50,11 @@ export const migrateToLatestDatabase = async (path: string) => {
|
||||
const update = (
|
||||
await connection.getUpdates(isRoot ? undefined : doc.guid)
|
||||
).map(update => update.data);
|
||||
// Buffer[] -> Uint8Array
|
||||
const data = new Uint8Array(Buffer.concat(update).buffer);
|
||||
applyUpdate(doc, data);
|
||||
// Buffer[] -> Uint8Array[]
|
||||
const data = update.map(update => new Uint8Array(update));
|
||||
data.forEach(data => {
|
||||
applyUpdate(doc, data);
|
||||
});
|
||||
// trigger data manually
|
||||
if (isRoot) {
|
||||
doc.getMap('meta');
|
||||
|
||||
Reference in New Issue
Block a user