{"record":{"id":"42e2ca883844fce1","repo":"makeplane/plane","slug":"publish-settings-not-found","errorCode":null,"errorMessage":"Publish settings not found","messagePattern":"Publish settings not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/space/store/issue-detail.store.ts","lineNumber":398,"sourceCode":"      runInAction(() => {\n        set(this.details, [issueID, \"reaction_items\"], newReactions);\n      });\n\n      await this.issueService.removeReaction(anchor, issueID, reactionHex);\n    } catch (_error) {\n      console.log(\"Failed to remove issue reaction\");\n      const reactions = await this.issueService.listReactions(anchor, issueID);\n      runInAction(() => {\n        set(this.details, [issueID, \"reaction_items\"], reactions);\n      });\n    }\n  };\n\n  addIssueVote = async (anchor: string, issueID: string, data: { vote: 1 | -1 }) => {\n    const publishSettings = this.rootStore.publishList?.publishMap?.[anchor];\n    const projectID = publishSettings?.project;\n    const workspaceSlug = publishSettings?.workspace_detail?.slug;\n    if (!projectID || !workspaceSlug) throw new Error(\"Publish settings not found\");\n\n    const newVote: IVote = {\n      actor_details: this.rootStore.user.currentActor,\n      vote: data.vote,\n    };\n\n    const filteredVotes = this.details[issueID].vote_items.filter(\n      (v) => v.actor_details?.id !== this.rootStore.user.data?.id\n    );\n\n    try {\n      runInAction(() => {\n        runInAction(() => {\n          set(this.details, [issueID, \"vote_items\"], [...filteredVotes, newVote]);\n        });\n      });\n\n      await this.issueService.addVote(anchor, issueID, data);","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/makeplane/plane/blob/1c8a60f858d8472aa56e29994ec1c7926da2c6ce/apps/space/store/issue-detail.store.ts#L380-L416","documentation":"Thrown by addIssueVote in the Space issue-detail store when the publish settings for the given anchor cannot resolve a project ID and workspace slug. publishList.publishMap[anchor] must yield an object with `.project` and `.workspace_detail.slug`; if either is missing, voting is impossible because the backend vote endpoint needs both identifiers.","triggerScenarios":"User on a public published issue tries to upvote/downvote before the publishList store has loaded/anchored the publish settings for that anchor; the anchor is valid for viewing but the publish record was partially deleted or migrated; the public page was opened with an anchor that has no matching entry in publishMap (e.g. wrong/old anchor).","commonSituations":"Race condition: vote UI rendered before publishList fetch resolved; share link with a stale anchor from before a project was renamed/moved; publish settings object shape changed across versions and an old client reads it incorrectly.","solutions":["Ensure publishList for the anchor is loaded before rendering the vote control (gate the UI on `!!publishSettings?.project && !!publishSettings?.workspace_detail?.slug`).","If the anchor is stale, re-fetch via the correct published-issue URL to obtain a fresh anchor.","Verify the publish record in the backend still references a non-deleted project and workspace.","Add an early-return or retry in addIssueVote when publishMap[anchor] is undefined rather than throwing."],"exampleFix":"// before: throws if publish settings not yet in store\nif (!projectID || !workspaceSlug) throw new Error(\"Publish settings not found\");\n// after: await the settings, or guard the UI upstream\nconst publishSettings = await this.rootStore.publishList?.fetchPublishSettings(anchor);\nif (!publishSettings?.project || !publishSettings?.workspace_detail?.slug) return;","handlingStrategy":"validation","validationCode":"const ps = rootStore.publishList?.publishMap?.[anchor];\nif (!ps?.project || !ps?.workspace_detail?.slug) {\n  await rootStore.publishList?.fetchPublishSettings?.(anchor);\n}\n// only call addIssueVote once both are present","typeGuard":"const hasPublishContext = (ps: unknown): ps is { project: string; workspace_detail: { slug: string } } =>\n  typeof ps === 'object' && ps !== null &&\n  typeof (ps as any).project === 'string' &&\n  typeof (ps as any)?.workspace_detail?.slug === 'string';","tryCatchPattern":"try { await addIssueVote(anchor, issueID, { vote }); }\ncatch (e) { setVoteError('Voting unavailable right now.'); }","preventionTips":["Gate the vote control UI on a resolved publish context (project + workspace slug).","Await publishList loading before rendering the public issue view.","Treat missing publish settings as 'feature unavailable' rather than throwing."],"tags":["space","publish","votes","race-condition","store-lookup"],"backgroundTag":null,"analyzedSha":"1c8a60f858d8472aa56e29994ec1c7926da2c6ce","analyzedAt":"2026-08-12T14:44:31.636Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}