hcengineering/platform · error · Error

No connection data found

Error message

No connection data found

What it means

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.

Source

Thrown at plugins/telegram-resources/src/components/IntegrationState.svelte:57

  const unsubscribers: (() => void)[] = []

  async function handleUnauthorized (): Promise<void> {
    if (isDisabled(integration)) {
      return
    }
    if (integrationClient === undefined) {
      integrationClient = await getIntegrationClient()
    }
    await integrationClient.setIntegrationEnabled(integration, false)
  }

  onMount(async () => {
    try {
      integrationClient = await getIntegrationClient()
      const connectionResult = await integrationClient.getConnection(integration)

      if (connectionResult?.data == null) {
        throw new Error('No connection data found')
      }

      connection = connectionResult
      channels = (await listChannels(connection?.data?.phone)).map((channel) => ({
        ...channel,
        syncEnabled: channel.mode === 'sync'
      }))
      isLoading = false
      status = OK
      subscribe()
    } catch (err: any) {
      status = ERROR
      isLoading = false
      console.error('Error loading channels:', err)
      if (isUnauthorizedError(err)) {
        await handleUnauthorized()
      }
    }

View on GitHub (pinned to 63e28dc964)

Solutions

  1. Complete the telegram connection flow (Connect.svelte: submit phone and confirmation code) so the service stores connection data.
  2. Verify the telegram integration service is running and reachable by the server.
  3. Check that the `integration` object/id passed to the component matches an existing integration document.
  4. Catch this error in onMount and show a 'connect account' prompt instead of a failed status page.

Example fix

// before
const connectionResult = await integrationClient.getConnection(integration)
if (connectionResult?.data == null) {
  throw new Error('No connection data found')
}
// after
const connectionResult = await integrationClient.getConnection(integration)
if (connectionResult?.data == null) {
  status = NOT_CONNECTED
  return // render connect-account UI instead of throwing
}
Defensive patterns

Strategy: validation

Validate before calling

const connectionResult = await integrationClient.getConnection(integration)
if (connectionResult?.data == null) {
  showConnectAccountPrompt()
  return
}

Type guard

function hasConnectionData(c: { data: unknown } | null | undefined): c is { data: NonNullable<unknown> } {
  return c?.data != null
}

Try / catch

try {
  await initIntegrationState()
} catch (e) {
  if (e.message === 'No connection data found') {
    status = NOT_CONNECTED
    renderConnectPrompt()
  } else throw e
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29). Data as JSON: /api/errors/5e023ea105745cc3. Report an issue: GitHub.