Skip to content

When subscribing to a Postgres changes, if multiple channels are subscribed to a given filtered change, only one of them gets the message #1524

@icopp

Description

@icopp

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

We've been encountering a lot of inconsistent race condition-like behavior around Realtime Postgres changes, and after digging through the websockets messages for a while I think I've found out the reason: When multiple subscriptions with different channel names should both receive a message for the same table row, only the most recently created subscription does.

This seems to only be an issue in the hosted environments. In local dev, every channel gets the message, as expected.

To Reproduce

  • Set up multiple Realtime Postgres changes subscriptions to the same table, with different channel names and different but overlapping filters (i.e. column_a=in.(A,B,C), column_a=in.(B,C,D), column_a=in.(D,E,F)).
  • Make a change in that table that should trigger multiple subscriptions (i.e., update a row that has column_a set to D).
  • See that on the hosted environments, only one channel gets the websocket update message.

Expected behavior

All channels with subscriptions get the message.

Screenshots

Local dev:

Image

Hosted Supabase environment:

Image

This is with identical table changes in the same version of the web app running both places.

System information

  • OS: n/a
  • Browser (if applies): Chrome 140.0.7339.80
  • Version of supabase-js: 2.56.0
  • Version of Node.js: 22.x (Vercel)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions