{"record":{"id":"5e023ea105745cc3","repo":"hcengineering/platform","slug":"no-connection-data-found","errorCode":null,"errorMessage":"No connection data found","messagePattern":"No connection data found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"plugins/telegram-resources/src/components/IntegrationState.svelte","lineNumber":57,"sourceCode":"  const unsubscribers: (() => void)[] = []\n\n  async function handleUnauthorized (): Promise<void> {\n    if (isDisabled(integration)) {\n      return\n    }\n    if (integrationClient === undefined) {\n      integrationClient = await getIntegrationClient()\n    }\n    await integrationClient.setIntegrationEnabled(integration, false)\n  }\n\n  onMount(async () => {\n    try {\n      integrationClient = await getIntegrationClient()\n      const connectionResult = await integrationClient.getConnection(integration)\n\n      if (connectionResult?.data == null) {\n        throw new Error('No connection data found')\n      }\n\n      connection = connectionResult\n      channels = (await listChannels(connection?.data?.phone)).map((channel) => ({\n        ...channel,\n        syncEnabled: channel.mode === 'sync'\n      }))\n      isLoading = false\n      status = OK\n      subscribe()\n    } catch (err: any) {\n      status = ERROR\n      isLoading = false\n      console.error('Error loading channels:', err)\n      if (isUnauthorizedError(err)) {\n        await handleUnauthorized()\n      }\n    }","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/plugins/telegram-resources/src/components/IntegrationState.svelte#L39-L75","documentation":"In IntegrationState.svelte's onMount, after obtaining an integration client, it calls integrationClient.getConnection(integration). If the result's `data` is null/undefined — meaning the telegram integration service has no stored connection (no phone/session) for this integration — it throws 'No connection data found'. The component requires an active connection to list channels and show status.","triggerScenarios":"OnMount calls getIntegrationClient() then getConnection(integration), and the response satisfies `connectionResult?.data == null`: the integration worker never connected the account, the connection was removed server-side, or the service is unreachable/returning an empty payload.","commonSituations":"Telegram integration configured in the workspace but the integration service was never started or the login (phone + code) was never completed; integration service restarted losing session state; wrong integration id passed to the component.","solutions":["Complete the telegram connection flow (Connect.svelte: submit phone and confirmation code) so the service stores connection data.","Verify the telegram integration service is running and reachable by the server.","Check that the `integration` object/id passed to the component matches an existing integration document.","Catch this error in onMount and show a 'connect account' prompt instead of a failed status page."],"exampleFix":"// before\nconst connectionResult = await integrationClient.getConnection(integration)\nif (connectionResult?.data == null) {\n  throw new Error('No connection data found')\n}\n// after\nconst connectionResult = await integrationClient.getConnection(integration)\nif (connectionResult?.data == null) {\n  status = NOT_CONNECTED\n  return // render connect-account UI instead of throwing\n}","handlingStrategy":"validation","validationCode":"const connectionResult = await integrationClient.getConnection(integration)\nif (connectionResult?.data == null) {\n  showConnectAccountPrompt()\n  return\n}","typeGuard":"function hasConnectionData(c: { data: unknown } | null | undefined): c is { data: NonNullable<unknown> } {\n  return c?.data != null\n}","tryCatchPattern":"try {\n  await initIntegrationState()\n} catch (e) {\n  if (e.message === 'No connection data found') {\n    status = NOT_CONNECTED\n    renderConnectPrompt()\n  } else throw e\n}","preventionTips":["Complete the telegram login flow before opening the integration state view","Keep the integration service running and monitored","Render a connect-account state instead of throwing when no session exists"],"tags":["telegram","integration","missing-data","configuration"],"backgroundTag":"missing-connection-data","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}