supabase / realtime-js

An isomorphic Javascript client for Supabase Realtime server.

Home Page:https://supabase.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

All subscriptions fail if publication not turned on for any table that is subscribed to.

yowzadave opened this issue · comments

Bug report

If subscribing to multiple tables, and any of the subscribed tables does not have publication turned on, the subscription to all tables will fail, with no error being thrown.

To Reproduce

If I have two tables, cats and dogs, and I have only added cats to the publication, then do something like:

const channel = supabase
  .channel("test")
  .on(
    "postgres_changes",
    { event: "update", schema: "public", table: "cats" },
    (payload) => console.log(payload)
  )
  .on(
    "postgres_changes",
    { event: "update", schema: "public", table: "dogs" },
    (payload) => console.log(payload)
  )
  .subscribe();

...then no subscription events will be fired, regardless of whether the cats or dogs table has been updated.

No error is provided to indicate that the subscription has failed.

@yowzadave thanks for the feedback here. will discuss this will the realtime team. cc/ @chasers