{"record":{"id":"9824429ab766120f","repo":"makeplane/plane","slug":"workspace-not-found","errorCode":null,"errorMessage":"Workspace not found","messagePattern":"Workspace not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/web/core/store/workspace/index.ts","lineNumber":234,"sourceCode":"      if (res && res.id) {\n        runInAction(() => {\n          Object.keys(data).forEach((key) => {\n            set(this.workspaces, [res.id, key], data[key as keyof IWorkspace]);\n          });\n        });\n      }\n      return res;\n    });\n\n  /**\n   * update workspace using the workspace slug and new workspace data\n   * @param {string} workspaceSlug\n   * @param {string} logoURL\n   */\n  updateWorkspaceLogo = (workspaceSlug: string, logoURL: string) => {\n    const workspaceId = this.getWorkspaceBySlug(workspaceSlug)?.id;\n    if (!workspaceId) {\n      throw new Error(\"Workspace not found\");\n    }\n    runInAction(() => {\n      set(this.workspaces[workspaceId], [\"logo_url\"], logoURL);\n    });\n  };\n\n  /**\n   * delete workspace using the workspace slug\n   * @param workspaceSlug\n   */\n  deleteWorkspace = async (workspaceSlug: string) => {\n    try {\n      await this.workspaceService.deleteWorkspace(workspaceSlug);\n      const updatedWorkspacesList = this.workspaces;\n      const workspaceId = this.getWorkspaceBySlug(workspaceSlug)?.id;\n      delete updatedWorkspacesList[`${workspaceId}`];\n      runInAction(() => {\n        this.workspaces = updatedWorkspacesList;","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/makeplane/plane/blob/1c8a60f858d8472aa56e29994ec1c7926da2c6ce/apps/web/core/store/workspace/index.ts#L216-L252","documentation":"Thrown by updateWorkspaceLogo in the web workspace store when getWorkspaceBySlug(workspaceSlug) returns no workspace (or one without an id). The logo update is purely an optimistic local set on workspaces[workspaceId], so the workspace must already be in the store.","triggerScenarios":"Calling updateWorkspaceLogo before the workspace list has been fetched/loaded into the store; passing a workspaceSlug that does not match any known workspace (typo, wrong case, renamed slug); the workspace was deleted between list load and logo update.","commonSituations":"Workspace settings page opened via deep link before fetchWorkspaces resolves; slug taken from a stale URL after the workspace was renamed; cross-account confusion where the slug belongs to a workspace the user is no longer in.","solutions":["Ensure fetchWorkspaces has completed (workspace in store) before enabling the logo upload.","Validate the slug matches a known workspace; refetch if not.","Pass the workspaceId directly when available instead of relying on slug lookup.","Show an inline error in the logo UI instead of throwing."],"exampleFix":"// before\nconst workspaceId = this.getWorkspaceBySlug(workspaceSlug)?.id;\nif (!workspaceId) throw new Error(\"Workspace not found\");\n// after\nconst workspaceId = this.getWorkspaceBySlug(workspaceSlug)?.id;\nif (!workspaceId) { await this.fetchWorkspaces(); return; }","handlingStrategy":"validation","validationCode":"const workspaceId = workspaceStore.getWorkspaceBySlug(workspaceSlug)?.id;\nif (!workspaceId) { await workspaceStore.fetchWorkspaces(); return; }","typeGuard":"const hasWorkspaceId = (w: unknown): w is { id: string } =>\n  typeof w === 'object' && w !== null && typeof (w as any).id === 'string';","tryCatchPattern":"try { workspaceStore.updateWorkspaceLogo(workspaceSlug, logoURL); }\ncatch (e) { if (/Workspace not found/.test(e.message)) { await workspaceStore.fetchWorkspaces(); } else throw e; }","preventionTips":["Fetch workspaces before enabling the logo upload.","Prefer workspaceId over slug lookup when available.","Refetch on a not-found rather than crashing the settings page."],"tags":["workspace","web","logo","store-lookup","precondition"],"backgroundTag":null,"analyzedSha":"1c8a60f858d8472aa56e29994ec1c7926da2c6ce","analyzedAt":"2026-08-12T14:44:31.636Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}