Supabase Realtime: the list never updates when data changes
Chat, notifications or a live table stay stale even though rows are changing in Supabase. The channel says SUBSCRIBED, and there is no error. Here is what actually drops the events.
Why it happens
supabase.channel().on("postgres_changes", ...).subscribe() only listens to tables in the supabase_realtime publication. Creating a table does not add it. If the table is missing from that publication, Realtime never sees the writes, no matter how the client is written.
A status of SUBSCRIBED means the WebSocket connected. It does not mean this user is allowed to see the row. Realtime applies the same Row Level Security rules as a normal select, using the role of the subscriber. When the SELECT policy does not match, the event is left out and no error is returned. An UPDATE can also disappear if the new row no longer passes the policy.
Two smaller mismatches cause the same silence: the filter string is wrong (it must look like room_id=eq.abc123), or the handler was attached after subscribe(). The channel name can be any string except "realtime".
How to fix it, step by step
- In the browser console, log the subscribe status. SUBSCRIBED with no payloads means the socket is fine and the publication or the policy is not.
- In Supabase → Database → Publications, under supabase_realtime, turn the table on. Or run: alter publication supabase_realtime add table your_table;
- With the same user the app uses, select that row: supabase.from("your_table").select("*").eq("id", id). If data is empty, Realtime is hiding the event for the same reason. Add a SELECT policy. Do not turn RLS off.
- For UPDATE events, check the policy against the new row, not only the old one. A policy that requires status = 'active' will drop the event that sets status to 'archived'.
- Match the listener to the table exactly: schema "public", the real table name, and a filter like column=eq.value with no spaces. Call .on() before .subscribe().
- If you need the previous values on UPDATE or DELETE, run alter table your_table replica identity full. With RLS enabled, payload.old still contains only the primary key, so do not branch on other old columns.
- Insert a row while the page is open and confirm a payload arrives. Postgres Changes is the simple option AI apps generate; Supabase recommends Broadcast when you need this at larger scale.
Paste-ready prompt for Lovable
My Supabase Realtime subscription shows SUBSCRIBED but the UI never updates. Please:
1. Do not disable RLS.
2. Name the table the client listens to, and give me the SQL: alter publication supabase_realtime add table <table>;
3. Show the SELECT policy that applies to that table. If a logged-in user cannot select the rows they should see, add a policy using auth.uid() (or the correct owner column) and explain it in plain English before applying.
4. Find the .channel().on('postgres_changes') call. Register the callback before .subscribe(), set schema and table exactly, and fix the filter to the form column=eq.value.
5. If the code reads payload.old besides the primary key, add: alter table <table> replica identity full; and stop depending on other old fields while RLS is on.
6. Log the subscribe status and the payload in development. Do not change unrelated features.FAQ
Why is there no error?
A missing publication means there is nothing to send. A failing SELECT policy filters the event out, the same way a select returns an empty list instead of an error.
Do I have to enable Realtime on every table?
No. Only tables you subscribe to. Supabase leaves database changes off until you add the table, because listening to everything has a cost.
Still broken?
Get a free diagnosis by email within 24 hours. Fixed or refunded.
Get a free diagnosisOr get the weekly fix digest:
Free: the Vibe-Code Fix Checklist.