Commit ee36e46
fix(realtime): prevent INVALID_STATE_ERROR crash in heartbeat
Use clearInterval instead of clearTimeout when resetting the heartbeat timer, and guard socket.send() with a readyState check so pings are only sent on an open WebSocket.
Fixes #101
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent ff16bab commit ee36e46
1 file changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
424 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
425 | 426 | | |
426 | 427 | | |
427 | 428 | | |
428 | | - | |
429 | | - | |
430 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
431 | 434 | | |
432 | 435 | | |
433 | 436 | | |
| |||
0 commit comments