You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When having both components in one page, one of the subscriptions doesn't fire on changing a row.
When changing the "*" in both components to differ from each other, for example
Component 1: "INSERT"
Component 2: "UPDATE",
logging of supabase.getSubscriptions() shows that only one of them is present in bindings.
I assume the first loaded subscription is replaced with the second loaded when calling subscribe() again, and I'm not sure if this really is a bug or intended.
To Reproduce
Create two separate realtime subscriptions on the same table
After creating both, log supabase.getSubscriptions(). Only one will be present.
Have them both load on one page
Change anything in the DB and observe which subscription reacts to the change.
Expected behavior
Both callbacks are run on DB change.
The text was updated successfully, but these errors were encountered:
@leandertolksdorf this is intended. When you do .on("*") you're essentially listening to the following topic realtime:*. Currently, Realtime only allows listening to unique topics per socket connection.
…el fetches
Supabase realtime has an undocumented limitation that the subscription
channel name must be unique. supabase/realtime#271
It is very badly documented, but the channel name can actually be any
string. So we can fix this by using the store name for the subscription
channel.
Fixing this resulted in more distinct subscriptions, so I had to put some
effort into reducing this number back down to the minimum.
If a store is already subscribed, we don't have to subscribe again. This
was especially important for the abteilungen store, which is
re-subscribed every time the group scores change (I think because of the
group ranking).
Also, force reloading should still not cause overlapping duplicate
requests. The forceReload flag should just affect the case when there is
already data present in the store.
NOTE: This is a duplicate of #246 because I'm not sure to which repository this actually belongs.
Bug report
Describe the bug
I have two independent React components from which I create supabase realtime subscriptions like this:
When having both components in one page, one of the subscriptions doesn't fire on changing a row.
When changing the
"*"
in both components to differ from each other, for exampleComponent 1:
"INSERT"
Component 2:
"UPDATE"
,logging of
supabase.getSubscriptions()
shows that only one of them is present inbindings
.I assume the first loaded subscription is replaced with the second loaded when calling
subscribe()
again, and I'm not sure if this really is a bug or intended.To Reproduce
supabase.getSubscriptions()
. Only one will be present.Expected behavior
Both callbacks are run on DB change.
The text was updated successfully, but these errors were encountered: