{"record":{"id":"5e5148b537d0058c","repo":"usebruno/bruno","slug":"workspace-path-not-found","errorCode":null,"errorMessage":"Workspace path not found","messagePattern":"Workspace path not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-app/src/providers/ReduxStore/slices/workspaces/actions.js","lineNumber":1013,"sourceCode":"\n        // Load API specs when workspace config is updated\n        await dispatch(loadWorkspaceApiSpecs(workspaceUid));\n      } catch (error) {\n      }\n    }\n  };\n};\n\nexport const saveWorkspaceDocs = (workspaceUid, docs) => {\n  return async (dispatch, getState) => {\n    try {\n      const workspace = getState().workspaces.workspaces.find((w) => w.uid === workspaceUid);\n      if (!workspace) {\n        throw new Error('Workspace not found');\n      }\n\n      if (!workspace.pathname) {\n        throw new Error('Workspace path not found');\n      }\n\n      await ipcRenderer.invoke('renderer:save-workspace-docs', workspace.pathname, docs || '');\n\n      dispatch(updateWorkspace({\n        uid: workspaceUid,\n        docs: docs\n      }));\n\n      return docs;\n    } catch (error) {\n      throw error;\n    }\n  };\n};\n\nexport const createCollectionInWorkspace = (collectionName, collectionFolderName, collectionLocation, workspaceUid) => {\n  return async (dispatch, getState) => {","sourceCodeStart":995,"sourceCodeEnd":1031,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-app/src/providers/ReduxStore/slices/workspaces/actions.js#L995-L1031","documentation":"Second guard in saveWorkspaceDocs (actions.js:1013): the workspace object exists but workspace.pathname is falsy. Without a pathname there is no on-disk directory to write the docs file to, so the IPC call would fail. Bruno creates some workspaces (temp/default placeholders) with pathname: null (see actions.js:96).","triggerScenarios":"Saving docs for an in-memory/scratch/default workspace that was never assigned a pathname, or for a workspace whose pathname was cleared during a failed open or rename.","commonSituations":"Operating on the default workspace before it is resolved to a real path; corrupted state where pathname was dropped; workspace whose directory was moved/deleted externally.","solutions":["Only render the WorkspaceDocs editor for workspaces that have a truthy pathname.","Resolve and persist the workspace pathname before enabling the Save action.","Surface a user-facing message ('This workspace is not saved to disk') instead of throwing."],"exampleFix":"// before\n{workspace && <WorkspaceDocs workspace={workspace} />}\n\n// after\n{workspace?.pathname && <WorkspaceDocs workspace={workspace} />}\n// plus, in the save handler:\nif (!workspace.pathname) {\n  toast.error('This workspace is not saved to disk');\n  return;\n}","handlingStrategy":"validation","validationCode":"const selectWorkspacePathname = (state, uid) =>\n  state.workspaces.workspaces.find((w) => w.uid === uid)?.pathname;\n\nconst pathname = selectWorkspacePathname(store.getState(), workspaceUid);\nif (!pathname) {\n  toast.error('This workspace is not saved to disk');\n  return;\n}","typeGuard":"const workspaceHasPath = (ws) => Boolean(ws && typeof ws.pathname === 'string' && ws.pathname.length > 0);","tryCatchPattern":"try {\n  await dispatch(saveWorkspaceDocs(workspaceUid, docs));\n} catch (e) {\n  toast.error(e.message === 'Workspace path not found'\n    ? 'This workspace is not saved to disk'\n    : e.message);\n}","preventionTips":["Only render the docs editor for workspaces with a truthy pathname.","Resolve/persist the workspace pathname before enabling Save.","Treat pathname-less workspaces (scratch/default) as non-persistent across the UI."],"tags":["workspace","pathname","docs","scratch","validation"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}