2.49.9 breaks postgres_change realtime feature
Opened this issue · 7 comments
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
- Upgrading from 2.49.8 to any version above (including .next) seems to break some realtime feature in react-native
To Reproduce
It's hard to describe as not all my listeners to postgres_changes are impacted.
Here's one listener that does not work after upgrade:
const channel = getConversationsChannel({ gameId })
.on(
'postgres_changes',
{
event: 'INSERT',
schema: 'public',
table: 'message',
filter: `game_id=eq.${gameId}`,
},
({ new: newMessage }) => {
receiveRemoteMessage(newMessage as RemoteMessagePayload);
},
)
.subscribe();
By "does not work" I mean:
- The insertion in the message table occurs
- The debug tool of realtime in the supabase dashboard shoes the event in the channel
- No data is received on the mobile app side
I have another realitme listener that works perfectly fine in my app, which is built the same way.
Maybe there is an issue with the number of sockets opened?
Expected behavior
The event should be logged on mobile side
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: ios and android
- expo 53 (latest), react-native 0.79.3
Hi, can you try out the version v2.50.1-next.6 and let me know if that fixes your issue?
Thanks.
I think the client is issuing expired tokens
2.50.0 is stable for us, 2.50.1 is breaking (postgres_changes, as well as broadcasting)
I have this issue. When the app starts, a single listener supabase.channel('...').on('postgres_changes', ...).subscribe() is set up; in the logs I see it is successfully established, but when I update a record—nothing happens. Then, when I change some code and hot reload runs, the useEffect unsubscribes and subscribes again, and after that the events start coming.
Used @supabase/supabase-js 2.57.4.
I tried installing @supabase/supabase-js 2.49.8, and the issue disappeared.
Tested on "expo": "~53.0.22", iOS and Android simulators in a dev build.
I confirm the issue is still here with latest 2.77.0 version, tested on expo 54
@grdsdev given that the breaking change is introduced in a known version, could someone at supabase may have hints of what may cause the issue?
Issue
- A row is inserted in a table with realtime enabled
- A log of the postgres event can be seen in the realtime inspector console
- No event is recevied by the webhook from the supabase-js client
The issue points out that the bug comes from the client and not the server.
Summary of investigation
Impacted version
2.49.9-next.1is the first broken version of supabase-js: https://github.com/supabase/supabase-js/pull/1428/files- This version introduces a bump in realtime-js from
2.11.2to2.11.9which may be the root cause
@grdsdev does this help?
Does it work if you have supabase.realtime.setAuth() before the subscribe?