{"record":{"id":"fc430044c200aec0","repo":"toeverything/AFFiNE","slug":"no-server-fc4300","errorCode":null,"errorMessage":"No server","messagePattern":"No server","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/modules/permissions/stores/guard.ts","lineNumber":42,"sourceCode":"    super();\n  }\n\n  async getWorkspacePermissions(): Promise<\n    Record<WorkspacePermissionActions, boolean>\n  > {\n    const { access } = await this.nbstoreService.realtime.request(\n      'workspace.access.get',\n      { workspaceId: this.workspaceService.workspace.id },\n      { timeoutMs: 10000 }\n    );\n    return access.permissions as Record<WorkspacePermissionActions, boolean>;\n  }\n\n  async getDocPermissions(\n    docId: string\n  ): Promise<Record<DocPermissionActions, boolean>> {\n    if (!this.workspaceServerService.server) {\n      throw new Error('No server');\n    }\n    const data = await this.workspaceServerService.server.gql({\n      query: getDocRolePermissionsQuery,\n      variables: {\n        workspaceId: this.workspaceService.workspace.id,\n        docId,\n      },\n    });\n    return data.workspace.doc.permissions;\n  }\n}\n","sourceCodeStart":24,"sourceCodeEnd":54,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/modules/permissions/stores/guard.ts#L24-L54","documentation":"getDocPermissions queries permission actions from the cloud server; when workspaceServerService.server is missing (no server bound to this workspace) it throws Error('No server') instead of issuing the request.","triggerScenarios":"Thrown by getDocPermissions in the guard store when workspaceServerService.server is null, preventing the doc role permissions GraphQL query from running.","commonSituations":"Doc permission checks fail for a workspace without an active cloud server connection. Ensure the workspace is connected to a server and the user is signed in.","solutions":["Connect to a server before performing permission checks.","Ensure the workspace has a server configured."],"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-14T00:17:10.932Z"}