Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The postgres subscription is not working at all #26363

Closed
1 of 2 tasks
ivan-robert opened this issue May 15, 2024 · 2 comments
Closed
1 of 2 tasks

The postgres subscription is not working at all #26363

ivan-robert opened this issue May 15, 2024 · 2 comments
Labels
bug Something isn't working realtime Supabase Realtime related

Comments

@ivan-robert
Copy link

ivan-robert commented May 15, 2024

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

I have a mobile app where I listen to postgres changes with a subscription. It worked perfectly fine until some weeks ago (I have not checked this feature for some time, I don't have the precise date when it broke).
I haven't changed a line of code. Now none of my subscriptions are working. I guess something changed supabase-side, because my code is still the same.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

export const subscribeToNotificationsAPI = ( userId: string, callback: (payload: NotificationUpdate) => void ) => { supabaseClient .channel(notifications-${userId}) .on( "postgres_changes", { event: "*", schema: "public", table: "notifications", filter: user_id=eq.${userId}, }, (payload) => { console.log("nothing happens, even if I send a notification"); callback(payload as unknown as NotificationUpdate); } ) .subscribe(); };

this function is called at the root of my app inside a useEffect. I checked it was called, it is.

Expected behavior

My console log is supposed to fire when adding a row to notifications table

System information

  • OS: MacOS (iOS simulator, react native)
  • Version of supabase-js: [2.42.3]
  • Version of Node.js: [20]
@ivan-robert ivan-robert added the bug Something isn't working label May 15, 2024
@saltcod saltcod added the realtime Supabase Realtime related label May 16, 2024
@encima
Copy link
Contributor

encima commented May 16, 2024

Hey there, thanks for opening!
If you have not touched it for some weeks, lets check some things before we debug further:

  • Is the project still running and not paused?
  • In the dashboard, can you access the Realtime Inspector and join those channels?
  • Have you tried toggling the realtime subscriptions or checking for output in the logs?

@ivan-robert
Copy link
Author

ivan-robert commented May 16, 2024

@encima Hello, thank you for your fast reply. You talking about the project and the dashboard gave me a hint about what I did wrong. The only thing that changed was my backend project, going from staging to production... and the realtime turned off on the tables !!

I turned it on again and of course everything worked fine again. I am sorry for the inconvenience and thank you for your patience 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working realtime Supabase Realtime related
Projects
None yet
Development

No branches or pull requests

3 participants