{"record":{"id":"0f3d22d61162f9ec","repo":"siyuan-note/siyuan","slug":"iddata-msg","errorCode":null,"errorMessage":"idData.msg","messagePattern":"idData\\.msg","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/block/util.ts","lineNumber":86,"sourceCode":"        folded: item.getAttribute(\"data-type\") === \"NodeHeading\" && item.getAttribute(\"fold\") === \"1\",\n    })), options.excludedChildIDs, options.childReplacements);\n    const sbElement = nodeElement.cloneNode() as HTMLElement;\n    sbElement.innerHTML = nodeElement.lastElementChild.outerHTML;\n    let previousId = options.previousID;\n    if (typeof previousId !== \"string\") {\n        previousId = getPreviousBlockSibling(nodeElement)?.getAttribute(\"data-node-id\");\n    }\n    let parentID = options.parentID || getEmbedChildOperationParentID(nodeElement) ||\n        getParentBlock(nodeElement)?.getAttribute(\"data-node-id\");\n    // 缩放和反链需要接口获取\n    if (!previousId && !parentID) {\n        if (options.resolveMissingPosition) {\n            const idData = await fetchSyncPost(\"/api/block/getBlockSiblingID\", {\n                id,\n                notebook: options.notebookID,\n            });\n            if (idData.code !== 0) {\n                throw new Error(idData.msg);\n            }\n            previousId = idData.data.previous;\n            parentID = idData.data.parent;\n        } else {\n            parentID = options.fallbackParentID;\n        }\n    }\n    const operationData = buildCancelSuperBlockOperations({\n        id,\n        data: sbElement.outerHTML,\n        childIDs,\n        foldedHeadingIDs,\n        previousID: previousId,\n        parentID,\n    });\n    const focusId = visibleChildElements[visibleChildElements.length - 1]?.getAttribute(\"data-node-id\") || previousId;\n    return {\n        ...operationData,","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/app/src/block/util.ts#L68-L104","documentation":"When resolveMissingPosition is enabled, getCancelSBOperations calls /api/block/getBlockSiblingID to determine the previous/parent ids for re-inserting a superblock. A non-zero response code causes the kernel's `idData.msg` to be thrown, since the sibling lookup is required to build the cancel operation.","triggerScenarios":"getBlockSiblingID is called for a block id the kernel cannot resolve — deleted block, wrong notebook parameter, or kernel index inconsistency preventing sibling lookup.","commonSituations":"Undo/cancel operations referencing blocks removed by a concurrent edit or sync; index corruption after a crash; passing a notebookID that does not match the block.","solutions":["Confirm the block id and notebookID are current (refresh the document before the operation)","Rebuild the index if sibling lookups fail consistently","Check kernel logs for the error detail returned in msg","Retry the operation after the document reloads"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"const hasSiblingData = (d: any): d is {data: {previous: string; parent: string}} => !!d?.data && \"previous\" in d.data && \"parent\" in d.data;","tryCatchPattern":"try {\n    await operationData(options);\n} catch (e) {\n    showMessage(e.message); // sibling lookup failed; refresh the document before retrying\n}","preventionTips":["Pass the correct notebookID alongside the block id","Rebuild the index if sibling lookups keep failing","Avoid operating on ids captured before concurrent edits/syncs"],"tags":["kernel-api","blocks","api-error"],"backgroundTag":"api-error-response","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}