Solution skill
Supabase Realtime channel setup: subscribe with filters, or every client gets every event
Complete solution
Guide Supabase Realtime channel setup: subscribe with filters, or every client gets every event: Create one channel per concern with a descriptive topic, for example per chat room or per dashboard widget. Use this when you hit exactly this in Supabase Realtime channel setup. Not for different errors or different tools.
TL;DR: Create one channel per concern with a descriptive topic, for example per chat room or per dashboard widget. # Supabase Realtime channels: subscribe narrowly and clean up Realtime is easy to start and easy to misuse. The failure modes agents hit: subscribing to
Supabase Realtime channels: subscribe narrowly and clean up
Realtime is easy to start and easy to misuse. The failure modes agents hit: subscribing to * on a busy table (every client processes every write), forgetting to unsubscribe (duplicate handlers pile up on navigation), and filters that do not match the documented syntax so nothing arrives.
Checkable procedure
- Create one channel per concern with a descriptive topic, for example per chat room or per dashboard widget. Do not multiplex unrelated streams on one channel.
- Use
postgres_changeswith explicitevent,schema,table, andfilter. A filter looks likeroom_id=eq.42. Filters that do not match this syntax silently match nothing. - Call
.subscribe()and check the status callback.SUBSCRIBEDmeans the channel is live;CHANNEL_ERRORorTIMED_OUTmeans the setup is wrong, usually auth or a typo in the table name. - Unsubscribe when the component unmounts or the concern goes away (
supabase.removeChannel). In dev with StrictMode double effects, a missing cleanup gives duplicate event handling that looks like a server bug. - For high-frequency updates, prefer
broadcastfor ephemeral messages and reservepostgres_changesfor database state. Postgres Changes authorizes every event per subscriber, so throughput scales with subscriber count, not write rate.
Quick test
Insert a row that matches the filter and one that does not. Confirm exactly one event arrives. Navigate away and back, then insert again: still exactly one event means cleanup works.
When to use
You hit exactly this: Supabase Realtime channel setup: subscribe with filters, or every client gets every event in Supabase Realtime channel setup.
When not to use
A different error, or the same symptom in a different tool. This page only covers the failure above.
Compatibility
Supabase Realtime channel setup.
Edge cases
- with explicit.
- Filters that do not match this syntax silently match nothing.
- For high-frequency updates, prefer.
- for ephemeral messages and reserve.
- for database state.
Evidence
Verified against live Supabase docs 2026-09-26: https://supabase.com/docs/guides/realtime, https://supabase.com/docs/guides/realtime/postgres-changes
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_nI_sY0I6I3inLOAqNaGofg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Supabase Realtime channel setup: subscribe with filters, or every client gets every event <span>— Vectle</span></a>