{"record":{"id":"ff174d26d8e97646","repo":"zed-industries/zed","slug":"graphql-error-json-stringify-data-errors","errorCode":null,"errorMessage":"GraphQL error: ${JSON.stringify(data.errors)}","messagePattern":"GraphQL error: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"script/get-release-notes-since","lineNumber":96,"sourceCode":"      method: \"POST\",\n      headers: {\n        Authorization: `Bearer ${GITHUB_ACCESS_TOKEN}`,\n        \"Content-Type\": \"application/json\",\n      },\n      body: JSON.stringify({\n        query,\n        variables: { owner: \"zed-industries\", repo: \"zed\", cursor },\n      }),\n    });\n\n    if (!response.ok) {\n      throw new Error(`HTTP error! status: ${response.status}`);\n    }\n\n    const data = await response.json();\n\n    if (data.errors) {\n      throw new Error(`GraphQL error: ${JSON.stringify(data.errors)}`);\n    }\n\n    if (!data.data || !data.data.repository || !data.data.repository.releases) {\n      throw new Error(`Unexpected response structure: ${JSON.stringify(data)}`);\n    }\n\n    const releases = data.data.repository.releases.nodes;\n    allReleases = allReleases.concat(releases);\n\n    hasNextPage = data.data.repository.releases.pageInfo.hasNextPage;\n    cursor = data.data.repository.releases.pageInfo.endCursor;\n\n    lastReleaseOnPage = releases[releases.length - 1];\n\n    if (\n      releases.length > 0 &&\n      new Date(lastReleaseOnPage.createdAt) < startDate\n    ) {","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/script/get-release-notes-since#L78-L114","documentation":"Returned by Copilot::sign_out (copilot.rs:837) as a ready Err task for the catch-all arm of the server-state match. Only CopilotServer::Running (sends the SignOut LSP request) and CopilotServer::Disabled (no-op Ok at copilot.rs:836) are handled; Starting and Error both fall through to 'copilot hasn't started yet'. Note sign_out already called update_sign_in_status(NotSignedIn) before the match, so local sign-in state is cleared even though the server-side SignOut request cannot be sent.","triggerScenarios":"Calling sign_out while the language server is still Starting (download/initialize in progress), or after it failed to start (CopilotServer::Error). The Running and Disabled states never produce this error.","commonSituations":"User signs out immediately after app launch while the npm package is still downloading; signing out right after a start failure; automated flows that call sign_out without checking status; double sign-out where the first attempt crashed the server.","solutions":["Treat it as benign when the goal is local sign-out: update_sign_in_status(NotSignedIn) already ran, so UI state is SignedOut; the token on the server side simply was not revoked.","If Starting, wait for status() to leave Status::Starting and call sign_out again so the SignOut request actually reaches the server.","If Error, fix or reinstall the server first, sign in, then sign out — or accept that the stale session remains authorized server-side.","Check status() is Status::Authorized/Unauthorized before calling sign_out to avoid the error entirely."],"exampleFix":"// before\nmatch copilot.sign_out(cx).await {\n    Err(e) => log::error!(\"sign out failed: {e:#}\"),\n    _ => {}\n}\n\n// after: only attempt server-side sign-out on a live server\nmatch copilot.status() {\n    Status::Authorized | Status::Unauthorized | Status::SigningIn { .. } | Status::SignedOut { .. } => {\n        copilot.sign_out(cx).await?;\n    }\n    _ => {\n        // not running: local status already reset to NotSignedIn by sign_out itself\n    }\n}","handlingStrategy":"validation","validationCode":"// sign_out only meaningfully hits the LSP on a live server.\nif matches!(copilot.status(), Status::Authorized | Status::Unauthorized | Status::SigningIn { .. }) {\n    copilot.sign_out(cx).await?;\n}\n// otherwise: local status was already reset to NotSignedIn inside sign_out","typeGuard":"fn can_sign_out(status: &Status) -> bool {\n    matches!(\n        status,\n        Status::Authorized | Status::Unauthorized | Status::SigningIn { .. } | Status::SignedOut { .. }\n    )\n}","tryCatchPattern":"match copilot.sign_out(cx).await {\n    Err(err) if format!(\"{err}\").contains(\"hasn't started yet\") => {\n        // benign: local sign-out already applied; optionally retry once the start task finishes\n    }\n    Err(err) => return Err(err),\n    Ok(()) => {}\n}","preventionTips":["Treat this error as informational: local sign-in state is cleared regardless.","Check status() before calling sign_out in automated flows.","If server-side token revocation matters, retry sign_out after status() leaves Starting.","Do not surface 'hasn't started yet' from sign_out as a hard error in the UI."],"tags":["copilot","zed","lifecycle","sign-out"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}