siyuan-note/siyuan · error · Error

relevantIDs.msg

Error message

relevantIDs.msg

What it means

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.

Solutions

  1. Verify the drag source element still exposes valid data-node-id and DRAG_SOURCE_NOTEBOOK_ID attributes before resolving root ID
  2. Treat a non-zero response.code as a no-op: abort the drop handling for that source instead of proceeding with an empty rootID
  3. Cache the root ID on the drag source via DRAG_SOURCE_ROOT_ID at drag start so the async lookup is only a fallback
  4. Check for locked/readonly notebooks before dispatching getBlockInfo for a drag source
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at app/src/protyle/util/editorCommonEvent.ts:192 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/cd46be2524abc5f3. Report an issue: GitHub.

Appendix: source

Thrown at app/src/protyle/util/editorCommonEvent.ts:192

    if (sourceRootID) {
        return sourceRootID;
    }
    const response = await fetchSyncPost("/api/block/getBlockInfo", {
        id: element.getAttribute("data-node-id"),
        notebook: dragSourceElement?.getAttribute(DRAG_SOURCE_NOTEBOOK_ID) || "",
    });
    return response.code === 0 ? response.data.rootID : "";
};

const cancelDetachedSourceSB = async (nodeElement: Element, excludedChildIDs: Set<string>) => {
    const sourceElement = nodeElement.closest(`[${DRAG_SOURCE_ROOT_ID}]`);
    const notebookID = sourceElement?.getAttribute(DRAG_SOURCE_NOTEBOOK_ID) || "";
    const relevantIDs = await fetchSyncPost("/api/block/getBlockRelevantIDs", {
        id: nodeElement.getAttribute("data-node-id"),
        notebook: notebookID,
    });
    if (relevantIDs.code !== 0) {
        throw new Error(relevantIDs.msg);
    }
    const operationData = await getCancelSBOperations(nodeElement, {
        notebookID,
        previousID: relevantIDs.data.previousID,
        parentID: relevantIDs.data.parentID || sourceElement?.getAttribute(DRAG_SOURCE_ROOT_ID) || "",
        fallbackParentID: sourceElement?.getAttribute(DRAG_SOURCE_ROOT_ID) || "",
        excludedChildIDs,
    });
    if (operationData.doOperations.length > 0) {
        nodeElement.querySelectorAll(".sb__resize").forEach(handle => handle.remove());
        nodeElement.lastElementChild.remove();
        nodeElement.replaceWith(...nodeElement.children);
    }
    return operationData;
};

const cancelDragSourceSB = async (nodeElement: Element, excludedChildIDs: Set<string>) => {
    /// #if !MOBILE

View on GitHub (pinned to 9f775e8a12)