Skip to content

feat: filter builder, select, heartbeat telemetry and presence fixes - #44

Merged
zoedsoupe merged 2 commits into
mainfrom
feat/rt-postgres-observability
Oct 16, 2026
Merged

zoedsoupe merged 2 commits into
mainfrom
feat/rt-postgres-observability

Conversation

@zoedsoupe

Copy link
Copy Markdown
Member

Problem

Several parity and correctness gaps remained:

  • postgres_changes bindings ignored select, so wide rows were sent in full.
  • Heartbeat health and round-trip latency were tracked internally but not observable.
  • There was no typed filter builder, only raw filter strings.
  • presence_state was read from the wrong nesting level (always empty), and presence diffs replaced whole keys instead of merging per phx_ref.
  • The HTTP fallback broadcast sent the prefixed realtime: topic and omitted private, so private-channel broadcasts failed authorization.
  • A spurious "no callback" warning fired when zero channels matched.

Solution

Add Supabase.Realtime.Filter, a pure typed builder with PostgREST quoting; accept select on postgres_changes bindings; emit [:supabase, :realtime, :heartbeat] telemetry with status and latency; add Supabase.Realtime.Presence with a per-phx_ref diff merge; fix the presence read path and the HTTP fallback body; and quiet the zero-channel warning.

Rationale

The filter builder is pure data in, wire string out, so it lives in the functional core and raises on invalid input while the on/3 boundary still returns tuples. Telemetry is used instead of a callback because it composes and is idiomatic on the BEAM. The presence merge ports phoenix's syncDiff so multi-device presence stays correct.

@zoedsoupe
zoedsoupe added this pull request to stack #45 October 16, 2026 01:44
@zoedsoupe
zoedsoupe force-pushed the feat/rt-postgres-observability branch 3 times, most recently from 880a3af to 6b555b9 Compare October 16, 2026 22:22
Base automatically changed from feat/rt-serializer-vsn2 to main October 16, 2026 22:24
@zoedsoupe
zoedsoupe force-pushed the feat/rt-postgres-observability branch from 6b555b9 to 9560012 Compare October 16, 2026 22:24
@zoedsoupe
zoedsoupe merged commit 6fa0dae into main Oct 16, 2026
24 checks passed
@zoedsoupe
zoedsoupe deleted the feat/rt-postgres-observability branch October 16, 2026 22:24
@zoedsoupe zoedsoupe mentioned this pull request Oct 16, 2026
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).
Sign up for free to 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