Skip to content

fix: clear stale heartbeat state on reconnect - #53

Open
AyobamiH wants to merge 1 commit into
supabase:mainfrom
AyobamiH:fix-worker-heartbeat-reset
Open

fix: clear stale heartbeat state on reconnect#53
AyobamiH wants to merge 1 commit into
supabase:mainfrom
AyobamiH:fix-worker-heartbeat-reset

Conversation

@AyobamiH

Copy link
Copy Markdown

Fixes the Phoenix-side cause of supabase/supabase-js#2625.

onConnOpen() now clears pendingHeartbeatRef and heartbeatSentAt on every successful connection open, regardless of autoSendHeartbeat. Timer scheduling remains gated behind autoSendHeartbeat, so worker-mode clients can continue driving heartbeats externally without inheriting stale heartbeat state from the previous socket.

Includes a regression test for autoSendHeartbeat: false that seeds stale heartbeat state and verifies it is cleared on open without starting the automatic heartbeat timer.

@AyobamiH
AyobamiH marked this pull request as ready for review August 23, 2026 11:34
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@AyobamiH