{"record":{"id":"248e40f519b0843d","repo":"toeverything/AFFiNE","slug":"no-workspace","errorCode":null,"errorMessage":"No workspace","messagePattern":"No workspace","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/modules/cloud/stores/invoices.ts","lineNumber":38,"sourceCode":"    }\n\n    return data.currentUser;\n  }\n\n  async fetchWorkspaceInvoices(\n    skip: number,\n    take: number,\n    workspaceId: string,\n    signal?: AbortSignal\n  ) {\n    const data = await this.graphqlService.gql({\n      query: workspaceInvoicesQuery,\n      variables: { skip, take, workspaceId },\n      context: { signal },\n    });\n\n    if (!data.workspace) {\n      throw new Error('No workspace');\n    }\n\n    return data.workspace;\n  }\n}\n","sourceCodeStart":20,"sourceCodeEnd":44,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/modules/cloud/stores/invoices.ts#L20-L44","documentation":"A GraphQL response-shape guard in the invoices store: after querying workspaceInvoicesQuery, a missing data.workspace field means the server did not return the workspace (deleted, inaccessible, or the id is wrong). It fires when fetchWorkspaceInvoices is called with a workspaceId the current user cannot resolve; the faulting input is the workspaceId that matches no visible workspace.","triggerScenarios":"Thrown in InvoicesStore.fetchWorkspaceInvoices when the GraphQL response has no workspace for the given workspaceId.","commonSituations":"Happens when viewing workspace invoices for a workspace that is inaccessible or deleted. Confirm workspace access and refresh.","solutions":["Select or create a workspace before viewing invoices.","Wait for the workspace to finish loading and retry."],"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-14T05:17:10.506Z"}