mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 08:48:01 +00:00
fix: extra logging in documents content migration (#5868)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
dedff23b31
commit
c88adbc5a9
@ -275,11 +275,7 @@ async function migrateTeamspacesMixins (client: MigrationClient): Promise<void>
|
||||
|
||||
async function migrateContentField (client: MigrationClient): Promise<void> {
|
||||
const ctx = new MeasureMetricsContext('migrate_content_field', {})
|
||||
|
||||
const storage = client.storageAdapter
|
||||
if (storage === undefined) {
|
||||
return
|
||||
}
|
||||
|
||||
const documents = await client.find<Document>(DOMAIN_DOCUMENT, {
|
||||
_class: document.class.Document,
|
||||
@ -290,17 +286,20 @@ async function migrateContentField (client: MigrationClient): Promise<void> {
|
||||
try {
|
||||
const ydoc = await loadCollaborativeDoc(storage, client.workspaceId, document.content, ctx)
|
||||
if (ydoc === undefined) {
|
||||
ctx.error('document content not found', { document: document.name })
|
||||
continue
|
||||
}
|
||||
|
||||
if (!ydoc.share.has('')) {
|
||||
if (!ydoc.share.has('') || ydoc.share.has('content')) {
|
||||
continue
|
||||
}
|
||||
|
||||
yDocCopyXmlField(ydoc, '', 'content')
|
||||
|
||||
await saveCollaborativeDoc(storage, client.workspaceId, document.content, ydoc, ctx)
|
||||
} catch {}
|
||||
} catch (err) {
|
||||
ctx.error('error document content migration', { error: err, document: document.name })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ export interface MigrationClient {
|
||||
model: ModelDb
|
||||
|
||||
migrateState: Map<string, Set<string>>
|
||||
storageAdapter?: StorageAdapter
|
||||
storageAdapter: StorageAdapter
|
||||
|
||||
workspaceId: WorkspaceId
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user