{"record":{"id":"cd7422c003449e06","repo":"tinyhumansai/openhuman","slug":"transport-manager-cloud-profile-missing-rpcurl","errorCode":null,"errorMessage":"[transport:manager] cloud profile missing rpcUrl","messagePattern":"\\[transport:manager\\] cloud profile missing rpcUrl","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/services/transport/TransportManager.ts","lineNumber":80,"sourceCode":"    }\n  }\n\n  // -- selection logic -------------------------------------------------------\n\n  private async selectTransport(): Promise<CoreTransport> {\n    const { kind } = this.profile;\n    log('[transport:manager] selecting kind=%s id=%s', kind, this.profile.id);\n\n    if (kind === 'local') {\n      const t = new LocalTransport(this.localRpcUrl, this.localToken);\n      log('[transport:manager] → LocalTransport');\n      return t;\n    }\n\n    if (kind === 'cloud') {\n      const { rpcUrl, sessionToken } = this.profile;\n      if (!rpcUrl) {\n        throw new Error('[transport:manager] cloud profile missing rpcUrl');\n      }\n      const t = new CloudHttpTransport(rpcUrl, sessionToken ?? null);\n      log('[transport:manager] → CloudHttpTransport rpcUrl=%s', rpcUrl);\n      return t;\n    }\n\n    if (kind === 'lan') {\n      const { rpcUrl } = this.profile;\n      if (!rpcUrl) {\n        throw new Error('[transport:manager] lan profile missing rpcUrl');\n      }\n      const t = new LanHttpTransport(rpcUrl);\n      log('[transport:manager] → LanHttpTransport rpcUrl=%s', rpcUrl);\n      return t;\n    }\n\n    if (kind === 'tunnel') {\n      return this.raceLanAndTunnel();","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/services/transport/TransportManager.ts#L62-L98","documentation":"TransportManager.getTransport() switches on profile.kind; for kind === 'cloud' it destructures rpcUrl and sessionToken from the ConnectionProfile and refuses to build a CloudHttpTransport when rpcUrl is empty. ConnectionProfile is defined in app/src/services/transport/profileStore.ts with kind: 'local' | 'lan' | 'tunnel' | 'cloud' — this error means a cloud-typed profile was persisted or handed in without its endpoint.","triggerScenarios":"A Redux coreMode-slice profile (persisted via userScopedStorage) saved by an older build whose cloud shape differed; manually constructing { kind: 'cloud' } without rpcUrl; a settings migration that renamed the field (e.g. url → rpcUrl).","commonSituations":"App upgrade where the persisted coreMode payload was written before the cloud profile schema changed; corrupted persisted state after crash mid-save; test fixtures missing rpcUrl.","solutions":["Re-select the cloud connection in Settings → Core connection so a complete profile is persisted","Clear/reset the persisted coreMode slice (or use the reset action) and re-onboard","If you construct profiles in code, assert rpcUrl is a non-empty absolute URL before calling createTransportManager","Add a persist-migration bump in the coreMode slice for the renamed field"],"exampleFix":"// before\nconst profile: ConnectionProfile = { kind: 'cloud' } as ConnectionProfile;\n// after\nconst profile: ConnectionProfile = { kind: 'cloud', rpcUrl: 'https://api.example.com/rpc', sessionToken: tok };","handlingStrategy":"validation","validationCode":"function assertCloudProfileReady(p: ConnectionProfile): void {\n  if (p.kind === 'cloud' && !p.rpcUrl) {\n    throw new Error('cloud profile incomplete — set rpcUrl before connecting');\n  }\n}","typeGuard":"function isCompleteCloudProfile(p: ConnectionProfile): boolean {\n  return p.kind !== 'cloud' || (typeof p.rpcUrl === 'string' && p.rpcUrl.length > 0);\n}","tryCatchPattern":null,"preventionTips":["Write cloud profiles atomically: kind and rpcUrl in the same state update, never kind first","Bump the coreMode persist version and migrate old shapes instead of hoping they match","On rehydrate, discard incomplete cloud profiles and default to kind 'local'"],"tags":["configuration","transport","cloud","connection-profile"],"backgroundTag":"invalid-connection-profile","analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}