Realtime not working in Node SSR
Hello! I'm struggling a lot to implement a feature in my Express app that needs Realtime capabilities, can someone help me out? 😓
My idea is to use realtime channels to listen and forward events from an
"ambulance" table for users that connect to a "watch" route. To accomplish that, I'm using the @supabase/ssr package.
I've verified that Realtime is active in my "ambulance" table and the user I'm using to test is allowed by the RLS rules, as I've tested by fetching ambulances while connected as they.
The problem is that even though my connection succeds, as my subscribe callback logs SUBSCRIBED, the callback passed to the on method - responsible for notifying changes - is not being called when I make changes to "ambulance" in the DB.
Here's the code in my ambulance controller that connects to realtime channels:
Also, here's a Minimal Reproduction Project, so the project structure can be better understood: https://github.com/ambulab-fenix/supabase-ssr-realtime
Thanks in advance to anyone that can give me a hand! 🙏GitHub
GitHub - ambulab-fenix/supabase-ssr-realtime
Contribute to ambulab-fenix/supabase-ssr-realtime development by creating an account on GitHub.
1 Reply
If you turn off RLS on the table does it work?