{"record":{"id":"2164709f2789dc4a","repo":"siyuan-note/siyuan","slug":"responsetransaction-msg","errorCode":null,"errorMessage":"responseTransaction.msg","messagePattern":"responseTransaction\\.msg","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/src/protyle/util/editorCommonEvent.ts","lineNumber":707,"sourceCode":"        });\n        updateListOrder(orderList.element, orderList.start);\n        Array.from(orderList.element.children).forEach((item) => {\n            if (item.classList.contains(\"protyle-attr\")) {\n                return;\n            }\n            doOperations.push({\n                action: \"update\",\n                id: item.getAttribute(\"data-node-id\"),\n                data: item.outerHTML\n            });\n        });\n    });\n    undoOperations.reverse();\n    for (let j = 0; j < copyFoldHeadingIds.length; j++) {\n        const childrenItem = copyFoldHeadingIds[j];\n        const responseTransaction = await fetchSyncPost(\"/api/block/getHeadingInsertTransaction\", {id: childrenItem.oldId});\n        if (responseTransaction.code !== 0) {\n            throw new Error(responseTransaction.msg);\n        }\n        responseTransaction.data.doOperations.splice(0, 1);\n        responseTransaction.data.doOperations[0].previousID = childrenItem.newId;\n        responseTransaction.data.undoOperations.splice(0, 1);\n        doOperations.push(...responseTransaction.data.doOperations);\n        undoOperations.push(...responseTransaction.data.undoOperations);\n    }\n    return {\n        doOperations,\n        undoOperations,\n        newSourceElements\n    };\n};\n\nconst dragSb = async (protyle: IProtyle, sourceElements: Element[], targetElement: Element, isBottom: boolean,\n                      direct: \"col\" | \"row\", isCopy: boolean) => {\n    if (!isCopy && isDragTargetInSource(sourceElements, targetElement)) {\n        return;","sourceCodeStart":689,"sourceCodeEnd":725,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/app/src/protyle/util/editorCommonEvent.ts#L689-L725","documentation":"While rebuilding undo state after a move operation, a transaction request sent via fetchSyncPost (responseTransaction) came back with a non-zero code or an unexpected msg. The msg field surfaces the kernel's rejection of a generated transaction — commonly because an operation references a block ID that no longer exists (the blocks were moved/deleted concurrently), the notebook is locked or read-only, or a permission check failed. The surrounding loop over copyFoldHeadingIds means folded-heading children are re-fetched per iteration, so any child that vanished mid-move triggers this on that iteration.","triggerScenarios":"Thrown at app/src/protyle/util/editorCommonEvent.ts:707 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect responseTransaction.code before using the payload and skip/collect the failing folded-heading child rather than applying partial undo operations","Batch the per-child transaction requests or resolve all child IDs up front to shrink the race window with concurrent modifications","Show the returned msg to the user via a toast so kernel-side rejections (locked notebook, missing block) are visible instead of silently dropped","Guard the move when the target or source notebook is locked/syncing before generating transactions"],"exampleFix":null,"handlingStrategy":"validation","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"}