{"record":{"id":"aad1e754cc69f03b","repo":"cube-js/cube","slug":"option-hearbeatinterval-is-deprecated-it-was-repl","errorCode":null,"errorMessage":"Option hearBeatInterval is deprecated. It was replaced by heartBeatInterval.","messagePattern":"Option hearBeatInterval is deprecated\\. It was replaced by heartBeatInterval\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cubejs-client-ws-transport/src/index.ts","lineNumber":72,"sourceCode":"\n  protected token: string | undefined;\n\n  protected ws: any = null;\n\n  protected messageCounter: number = 1;\n\n  protected messageIdToSubscription: Record<number, Subscription> = {};\n\n  protected messageQueue: Message[] = [];\n\n  public constructor({ authorization, apiUrl, heartBeatInterval, hearBeatInterval }: WebSocketTransportOptions) {\n    this.token = authorization;\n    this.apiUrl = apiUrl;\n\n    if (heartBeatInterval) {\n      this.heartBeatInterval = heartBeatInterval;\n    } else if (hearBeatInterval) {\n      console.warn('Option hearBeatInterval is deprecated. It was replaced by heartBeatInterval.');\n      this.heartBeatInterval = hearBeatInterval;\n    }\n  }\n\n  public set authorization(token) {\n    this.token = token;\n\n    if (this.ws) {\n      this.ws.close();\n    }\n  }\n\n  public async close(): Promise<void> {\n    if (this.ws) {\n      // Flush send queue before sending close frame\n      this.ws.sendQueue();\n\n      this.ws.close();","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-client-ws-transport/src/index.ts#L54-L90","documentation":"A deprecation warning from the WebSocket transport constructor: the misspelled option hearBeatInterval was passed instead of heartBeatInterval. The misspelled key is still read as a fallback so existing integrations keep working, but the constructor flags the typo so callers migrate to the corrected name.","triggerScenarios":"new WebSocketTransport({ ..., hearBeatInterval: n }) without heartBeatInterval, or after heartBeatInterval, hits the else-if branch and warns.","commonSituations":"Older code/configs written against the misspelled option; copied examples from pre-rename docs; TS types may not flag it if options were passed loosely.","solutions":["Rename the option to heartBeatInterval in the transport constructor options","Type the options object as WebSocketTransportOptions so typos are caught at compile time","Search the codebase for hearBeatInterval to remove all occurrences"],"exampleFix":"// before\nnew WebSocketTransport({ apiUrl: url, hearBeatInterval: 30000 });\n// after\nnew WebSocketTransport({ apiUrl: url, heartBeatInterval: 30000 });","handlingStrategy":"validation","validationCode":"if ('hearBeatInterval' in opts) console.warn('Rename hearBeatInterval -> heartBeatInterval');","typeGuard":"function isTransportOptions(o: object): o is { heartBeatInterval?: number } {\n  return !('hearBeatInterval' in o);\n}","tryCatchPattern":null,"preventionTips":["Use the typed WebSocketTransportOptions interface","Search codebases for the misspelled hearBeatInterval","Update copied examples from old docs"],"tags":["deprecation","websocket","client","typo"],"backgroundTag":"deprecated-option-renamed","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}