{"record":{"id":"cd46be2524abc5f3","repo":"siyuan-note/siyuan","slug":"relevantids-msg","errorCode":null,"errorMessage":"relevantIDs.msg","messagePattern":"relevantIDs\\.msg","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/src/protyle/util/editorCommonEvent.ts","lineNumber":192,"sourceCode":"    if (sourceRootID) {\n        return sourceRootID;\n    }\n    const response = await fetchSyncPost(\"/api/block/getBlockInfo\", {\n        id: element.getAttribute(\"data-node-id\"),\n        notebook: dragSourceElement?.getAttribute(DRAG_SOURCE_NOTEBOOK_ID) || \"\",\n    });\n    return response.code === 0 ? response.data.rootID : \"\";\n};\n\nconst cancelDetachedSourceSB = async (nodeElement: Element, excludedChildIDs: Set<string>) => {\n    const sourceElement = nodeElement.closest(`[${DRAG_SOURCE_ROOT_ID}]`);\n    const notebookID = sourceElement?.getAttribute(DRAG_SOURCE_NOTEBOOK_ID) || \"\";\n    const relevantIDs = await fetchSyncPost(\"/api/block/getBlockRelevantIDs\", {\n        id: nodeElement.getAttribute(\"data-node-id\"),\n        notebook: notebookID,\n    });\n    if (relevantIDs.code !== 0) {\n        throw new Error(relevantIDs.msg);\n    }\n    const operationData = await getCancelSBOperations(nodeElement, {\n        notebookID,\n        previousID: relevantIDs.data.previousID,\n        parentID: relevantIDs.data.parentID || sourceElement?.getAttribute(DRAG_SOURCE_ROOT_ID) || \"\",\n        fallbackParentID: sourceElement?.getAttribute(DRAG_SOURCE_ROOT_ID) || \"\",\n        excludedChildIDs,\n    });\n    if (operationData.doOperations.length > 0) {\n        nodeElement.querySelectorAll(\".sb__resize\").forEach(handle => handle.remove());\n        nodeElement.lastElementChild.remove();\n        nodeElement.replaceWith(...nodeElement.children);\n    }\n    return operationData;\n};\n\nconst cancelDragSourceSB = async (nodeElement: Element, excludedChildIDs: Set<string>) => {\n    /// #if !MOBILE","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/app/src/protyle/util/editorCommonEvent.ts#L174-L210","documentation":"A fetchSyncPost call to /api/block/getBlockInfo returned a non-zero code (or a response whose data.rootID is unavailable), so the caller cannot resolve the root document ID for a dragged detached block. It typically fires when the drag source element carries a stale or missing data-node-id / drag-source notebook attribute, or when the block was deleted server-side between drag and drop, leaving the resolver with no rootID to anchor the subsequent transaction.","triggerScenarios":"Thrown at app/src/protyle/util/editorCommonEvent.ts:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the drag source element still exposes valid data-node-id and DRAG_SOURCE_NOTEBOOK_ID attributes before resolving root ID","Treat a non-zero response.code as a no-op: abort the drop handling for that source instead of proceeding with an empty rootID","Cache the root ID on the drag source via DRAG_SOURCE_ROOT_ID at drag start so the async lookup is only a fallback","Check for locked/readonly notebooks before dispatching getBlockInfo for a drag source"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}