Skip to content

Using stream convenience function doesn't work with private-only realtime channels setting. #1311

@matthew-nm

Description

@matthew-nm

I have a table with proper RLS policies set up and I'm using the stream function (stream docs) to show a list and keep up with changes.

This was all working great. Later, when I began using realtime broadcasts for other features, I decided I didn't want to allow public realtime connections so I went to the realtime settings and changed the "Allow public access to channels" options to False. Changing this connection immediately broke my stream function with the following error:

RealtimeSubscribeException(status: RealtimeSubscribeStatus.channelError, details:
Exception: "PrivateOnly: This project only allows private channels")

According to the documentation here, the private setting shouldn't affect Postgres Changes (since those use the RLS policies of the table being watched, not realtime.messages). Perhaps I'm misunderstanding, but I thought the stream function used Postgres Changes under the hood since I'm not setting up any broadcast triggers or anything like that.

So if I'm not mistaken, I don't see why disabling public realtime channels would break the stream function.

My user is definitely signed in and has proper RLS access, since once I enable public access again, I can create, view, and delete records just fine.

Is this a bug, or am I misunderstanding how the stream function works?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions