Today I found using the Y.logupdate to log the update, the output always null:
async getYDoc(docName: string): Promise<Y.Doc> {
const updates: Array<TeXSync> = await this.getPgBulkData(
this.pool,
{ values: true, keys: false, reverse: false },
docName
);
const ydoc = new Y.Doc();
ydoc.transact(() => {
try {
for (let i = 0; i < updates.length; i++) {
let update: TeXSync = updates[i];
let updateVal: Uint8Array = update.value;
Y.logUpdate(updateVal);
Y.applyUpdate(ydoc, updateVal);
}
} catch (err) {
console.error("apply update failed", err);
}
});
return ydoc;
}
}
this is the output:
Structs:
logging.node.js:79
DeleteSet:
logging.node.js:79
Structs:
logging.node.js:79
DeleteSet:
logging.node.js:79
Structs:
logging.node.js:79
DeleteSet:
logging.node.js:79
Structs:
logging.node.js:79
DeleteSet:
logging.node.js:79
Structs:
logging.node.js:79
DeleteSet:
logging.node.js:79
Structs:
am I missing something? I have tried to tracing into the method and the structs not null.