mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-11 12:17:44 +02:00
fix: another attempt to migrate empty document fields (#7004)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
@@ -1270,7 +1270,7 @@ async function updateYDoc (
|
||||
doc: RelatedDocument
|
||||
): Promise<void> {
|
||||
try {
|
||||
const ydoc = await loadCollaborativeDoc(storage, workspaceId, _id, ctx)
|
||||
const ydoc = await loadCollaborativeDoc(ctx, storage, workspaceId, _id)
|
||||
if (ydoc === undefined) {
|
||||
ctx.error('document content not found', { document: contentDoc._id })
|
||||
return
|
||||
@@ -1284,7 +1284,7 @@ async function updateYDoc (
|
||||
})
|
||||
|
||||
if (updatedYDoc !== undefined) {
|
||||
await saveCollaborativeDoc(storage, workspaceId, _id, updatedYDoc, ctx)
|
||||
await saveCollaborativeDoc(ctx, storage, workspaceId, _id, updatedYDoc)
|
||||
}
|
||||
} catch {
|
||||
// do nothing, the collaborative doc does not sem to exist yet
|
||||
|
||||
@@ -199,7 +199,7 @@ async function processMigrateMarkupFor (
|
||||
if (blob === undefined) {
|
||||
try {
|
||||
const ydoc = markupToYDoc(value, attribute.name)
|
||||
await saveCollaborativeDoc(storageAdapter, workspaceId, collaborativeDoc, ydoc, ctx)
|
||||
await saveCollaborativeDoc(ctx, storageAdapter, workspaceId, collaborativeDoc, ydoc)
|
||||
} catch (err) {
|
||||
console.error('failed to process document', doc._class, doc._id, err)
|
||||
}
|
||||
@@ -298,7 +298,7 @@ export async function restoreLostMarkup (
|
||||
console.log(doc._class, doc._id, attr.name, markup)
|
||||
if (command === 'restore') {
|
||||
const ydoc = markupToYDoc(markup, attr.name)
|
||||
await saveCollaborativeDoc(storageAdapter, workspaceId, value, ydoc, ctx)
|
||||
await saveCollaborativeDoc(ctx, storageAdapter, workspaceId, value, ydoc)
|
||||
}
|
||||
restored = true
|
||||
break
|
||||
@@ -329,7 +329,7 @@ export async function restoreLostMarkup (
|
||||
console.log(doc._class, doc._id, attr.name, markup)
|
||||
if (command === 'restore') {
|
||||
const ydoc = markupToYDoc(markup, attr.name)
|
||||
await saveCollaborativeDoc(storageAdapter, workspaceId, value, ydoc, ctx)
|
||||
await saveCollaborativeDoc(ctx, storageAdapter, workspaceId, value, ydoc)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user