{"record":{"id":"62cb2318fcc6f2ed","repo":"toeverything/AFFiNE","slug":"node-not-found","errorCode":null,"errorMessage":"Node not found","messagePattern":"Node not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/modules/organize/stores/folder.ts","lineNumber":69,"sourceCode":"    index: string\n  ) {\n    const parent = this.dbService.db.folders.get(parentId);\n    if (parent === null || parent.type !== 'folder') {\n      throw new Error('Parent folder not found');\n    }\n\n    this.dbService.db.folders.create({\n      parentId,\n      type,\n      data: nodeId,\n      index: index,\n    });\n  }\n\n  renameNode(nodeId: string, name: string) {\n    const node = this.dbService.db.folders.get(nodeId);\n    if (node === null) {\n      throw new Error('Node not found');\n    }\n    if (node.type !== 'folder') {\n      throw new Error('Cannot rename non-folder node');\n    }\n    this.dbService.db.folders.update(nodeId, {\n      data: name,\n    });\n  }\n\n  createFolder(parentId: string | null, name: string, index: string) {\n    if (parentId) {\n      const parent = this.dbService.db.folders.get(parentId);\n      if (parent === null || parent.type !== 'folder') {\n        throw new Error('Parent folder not found');\n      }\n    }\n\n    return this.dbService.db.folders.create({","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/modules/organize/stores/folder.ts#L51-L87","documentation":"A lookup guard in renameNode: it fetches nodeId from the folders table and throws when get returns null. It fires when a rename is requested for a node id that does not exist in the organize tree — stale reference or already-deleted node; the faulting input is the nodeId argument.","triggerScenarios":"Thrown when renameNode or moveNode is called with a nodeId that has no record in the folders DB.","commonSituations":"Triggered by renaming or moving an organize-tree entry that no longer exists, often due to stale UI state after deletion. Refresh the sidebar tree and retry.","solutions":["The node may have been deleted; refresh the organize tree.","Verify the node id before the operation."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}