Repository navigation
feat: rejoin backoff, duplicate binding dedup and aligned binding ids - #46
Merged
Merged
Conversation
zoedsoupe
force-pushed
the
feat/rt-postgres-observability
branch
from
October 16, 2026 22:17
9d32623 to
880a3af
Compare
zoedsoupe
force-pushed
the
feat/rt-rejoin-dedup
branch
from
October 16, 2026 22:17
2310ad1 to
0023ea7
Compare
zoedsoupe
force-pushed
the
feat/rt-postgres-observability
branch
2 times, most recently
from
October 16, 2026 22:24
6b555b9 to
9560012
Compare
zoedsoupe
force-pushed
the
feat/rt-rejoin-dedup
branch
from
October 16, 2026 22:26
0023ea7 to
7170489
Compare
Merged
zoedsoupe
added a commit
that referenced
this pull request
Oct 19, 2026
🚀 Want to release this? --- ## [0.6.0](v0.5.0...v0.6.0) (2026-10-16) ### Features * filter builder, select, heartbeat telemetry and presence fixes ([#44](#44)) ([6fa0dae](6fa0dae)) * rejoin backoff, duplicate binding dedup and aligned binding ids ([#46](#46)) ([ce458d9](ce458d9)) * serializer behaviour and vsn 2.0.0 binary framing ([#43](#43)) ([3aec1d6](3aec1d6)) ### Bug Fixes * realtime protocol correctness (join, ack, heartbeat, tls) ([#42](#42)) ([73548ac](73548ac)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Three gaps in the realtime client:
:erroreduntil the next socket reconnect. Phoenix retries a failed join on its own with backoff; the client did not.postgres_changesbinding is silently accepted, but the server collapses identical filters into one subscription, which desyncs the client's positional binding ids.Solution
Supabase.Realtime.Rejoin, a pure module holding the phoenix backoff sequence (1s, 2s, 5s, then 10s), and a per-channel rejoin timer owned by the Registry. A failed join (error/timeoutreply,phx_error, failed leave) arms a retry that re-joins with a fresh join_ref and token. The timer is cleared on:open/:closed, on a successful join, on unsubscribe and on close. A:rejoin_after_msstart option overrides the sequence.postgres_changesbinding at theon/3boundary with{:error, :duplicate_binding}, comparing event, schema, table, filter and select.postgres_changesentries oldest-first, matching realtime-js, so the server's positional ids line up with the stored bindings.Realtime.send/3docs, which showed broadcasting through the raw send path.Rationale
The timer lives in the Registry because every join and cancel trigger already lands there; putting it in the Connection would need new cross-process messages. Dedup returns a tuple rather than silently ignoring the duplicate (as realtime-js does) to match the boundary contract already set by
:invalid_select. The payload-order fix makes the existing reverse-zip correct without touching it, and matches the reference client.