{"record":{"id":"aa89cd228c42c661","repo":"toeverything/AFFiNE","slug":"no-logged-in-aa89cd","errorCode":null,"errorMessage":"No logged in","messagePattern":"No logged in","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/modules/cloud/stores/subscription.ts","lineNumber":62,"sourceCode":"  constructor(\n    private readonly gqlService: GraphQLService,\n    private readonly globalCache: GlobalCache,\n    private readonly urlService: UrlService,\n    private readonly serverService: ServerService\n  ) {\n    super();\n  }\n\n  async fetchSubscriptions(abortSignal?: AbortSignal) {\n    const data = await this.gqlService.gql({\n      query: subscriptionQuery,\n      context: {\n        signal: abortSignal,\n      },\n    });\n\n    if (!data.currentUser) {\n      throw new Error('No logged in');\n    }\n\n    return {\n      userId: data.currentUser?.id,\n      subscriptions: data.currentUser?.subscriptions,\n    };\n  }\n\n  async fetchWorkspaceSubscriptions(\n    workspaceId: string,\n    abortSignal?: AbortSignal\n  ) {\n    const data = await this.gqlService.gql({\n      query: getWorkspaceSubscriptionQuery,\n      variables: {\n        workspaceId,\n      },\n      context: {","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/modules/cloud/stores/subscription.ts#L44-L80","documentation":"A GraphQL response-shape guard in the subscription store: after running subscriptionQuery, data.currentUser is absent, meaning the request executed but no authenticated user was returned (session expired or never established). It fires when fetchSubscriptions runs while the client has no valid login; the fault is the auth/session state, not the query itself.","triggerScenarios":"Thrown in SubscriptionStore.fetchSubscriptions when the GraphQL response has no currentUser, i.e. no authenticated session exists.","commonSituations":"Seen when opening subscription/plan settings while signed out or with an expired token. Sign in again to view subscription info.","solutions":["Sign in before accessing subscription information.","Re-authenticate 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"}