-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
Getting CHANNEL_ERROR when trying to connect to private broadcast channel with a simple RLS policy #1111
Comments
do you have other policies on |
just for a sanity check, what happens if you have |
i would get I've tested from |
interesting, can you try to do that query in supabase studio impersonating one of your users to see the output of the select? |
@teddyhartanto i was worried it might be an issue with the access token but if the first two are working then it's correct. can you try the last one again but fully qualify the table name? (EXISTS ( SELECT 1 FROM public.chat_room_members)) |
@w3b6x9 yeah i think it's not the access token. I monitored the WS payloads and I could see that the I have also tried using the fully qualified table name, but it doesn't seem to matter. On save, Supabase Realtime would truncate the table name from Eg: (EXISTS ( SELECT 1 FROM non_existent)) |
In Studio you can disable features by going to Regarding the policies, could you open a ticket in our support system? that will make it easier for me to understand what could be happening |
Bug report
Describe the bug
I'm building an in-app chat for my application. Chat works fine when the channel is public. But, I can't seem to get it working when I tried making the channels private.
Here's my frontend code:
I got the following log in the console:
My RLS:
As you can see, it's a simple RLS. Even then, I'm getting a
CHANNEL_ERROR
. The connection would succeed if I removeFROM chat_room_members
in the RLS policy. For some unknown reason, querying from any table in the policy fails the connection. What's happening?I combed over docs, github discussions, github issues, and now Discord and I couldn't find anything. Am I missing something obvious here?
Expected behavior
SUBSCRIBED
instead ofCHANNEL_ERROR
System information
The text was updated successfully, but these errors were encountered: