You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a similar issue when using slate-yjs with y-indexeddb. Each time the slate editor is mounted, the contents are duplicated. The indexeddb updates table also seems to double in size each time the page is loaded. I'm not doing anything special here. Just passing along the y doc which holds my sharedType...
This is frontend code
useEffect(() => {
new IndexeddbPersistence(docName, provider.document)
}, [])
This is backend code
async onLoadDocument(data) {
if (data.document.isEmpty(data.documentName)) {
const insertDelta = slateNodesToInsertDelta(initialValue)
const sharedRoot = data.document.get(data.documentName, Y.XmlText) as unknown as Y.XmlText
sharedRoot.applyDelta(insertDelta)
}
return data.document
}
The text was updated successfully, but these errors were encountered:
If hocuspocus is using sqlite - it would empty its local db on server restart, then pull the content from your remote server.
In this case it would think the document is empty and insert the remote content again, then serve that to the client, which also has the content in indexeddb. This would result in dupe content.
if you're using sqlite, try switching to a db that wont get wiped on server restart
Hi @BitPhinix
I have a similar issue when using slate-yjs with y-indexeddb. Each time the slate editor is mounted, the contents are duplicated. The indexeddb updates table also seems to double in size each time the page is loaded. I'm not doing anything special here. Just passing along the y doc which holds my sharedType...
This is frontend code
This is backend code
The text was updated successfully, but these errors were encountered: