{"record":{"id":"47f550a32ce1cd96","repo":"koala73/worldmonitor","slug":"authentication-unavailable-while-loading-api-plan","errorCode":null,"errorMessage":"Authentication unavailable while loading API plan-limit notices. Try again.","messagePattern":"Authentication unavailable while loading API plan-limit notices\\. Try again\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/services/api-plan-limit-notices.ts","lineNumber":42,"sourceCode":"  dimension: ApiPlanLimitDimension;\n  state: ApiPlanLimitNoticeState;\n  windowKey: string;\n  usage: number;\n  limit: number | null;\n  usageRatio: number | null;\n  upgradeTargetPlanKey?: string;\n  ctaKind: ApiPlanLimitCtaKind;\n  blockedReason?: string;\n}\n\nexport async function listCurrentPlanLimitNotices(): Promise<ApiPlanLimitNotice[]> {\n  const userId = getCurrentClerkUser()?.id;\n  if (!userId) return [];\n  const [client, api] = await Promise.all([getConvexClient(), getConvexApi()]);\n  if (!client || !api) return [];\n  if (!await waitForConvexAuthForUser(userId)) {\n    assertAccountStillCurrent(userId, 'loading API plan-limit notices');\n    throw new Error('Authentication unavailable while loading API plan-limit notices. Try again.');\n  }\n  return settleAccountOperation(\n    userId,\n    'loading API plan-limit notices',\n    () => client.query((api as any).apiPlanLimitNotices.listCurrentForUser, {}),\n  );\n}\n\nexport async function acknowledgePlanLimitNotice(noticeId: string): Promise<void> {\n  const userId = getCurrentClerkUser()?.id;\n  if (!userId) throw new Error('Sign in to acknowledge API plan-limit notices.');\n  const [client, api] = await Promise.all([getConvexClient(), getConvexApi()]);\n  if (!client || !api) throw new Error('Convex unavailable');\n  if (!await waitForConvexAuthForUser(userId)) {\n    throw new Error('Account changed while acknowledging the API plan-limit notice. Try again.');\n  }\n  await settleAccountOperation(\n    userId,","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/koala73/worldmonitor/blob/eeab0a219fce0f02a00603b532dbae9041b934ac/src/services/api-plan-limit-notices.ts#L24-L60","documentation":"UI service error in listCurrentPlanLimitNotices: the user is signed in but Convex auth had not propagated for that user when the query ran. A session-propagation timing failure, mirroring the same guard used across Convex-backed services.","triggerScenarios":"Thrown at src/services/api-plan-limit-notices.ts:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry — the Convex auth token usually propagates shortly after sign-in","Reload the page if the error keeps recurring"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eeab0a219fce0f02a00603b532dbae9041b934ac","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}