realtime-js: Supabase Realtime not working with RLS

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

Supabase Realtime doesn’t get emit events when provided with table name, but works without table name in localhost

To Reproduce

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

  1. Went to /database/replication and turned on supabase_realtime
Screenshot 2023-10-10 at 3 07 12 PM
  1. Turned on table for which I want realtime events
Screenshot 2023-10-10 at 3 07 20 PM

In Javascript, If I do something like this, this won’t work

supabase
            .client 
            .channel('user_list_changes')
            .on(
                'postgres_changes',
                {
                    event: '*',
                    schema: 'public',
                    table: 'users_list',
                },
                (payload: any) => console.log('payload', payload),
            )
            .subscribe();

but this would

supabase
           .client 
           .channel('user_list_changes')
           .on(
               'postgres_changes',
               {
                   event: '*',
                   schema: 'public',
               },
               (payload: any) => console.log('payload', payload),
           )
           .subscribe();

Expected behavior

I was expecting to receive events when provided with table_name

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: Mac
  • Browser: Brave
  • Version of supabase-js:
   "@supabase/supabase-js@^2.10.0":
   "@supabase/functions-js" "^2.1.0"
    "@supabase/gotrue-js" "^2.46.1"
    "@supabase/postgrest-js" "^1.8.0"
    "@supabase/realtime-js" "^2.7.4"
    "@supabase/storage-js" "^2.5.1"
    ```
- Version of Node.js: 18.3.0

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 20 (6 by maintainers)

Most upvoted comments

Same for me, anyone had any luck?