Skip to content
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

Realtime allows multiple subscriptions to table #127

Closed
GaryAustin1 opened this issue Dec 31, 2021 · 3 comments · Fixed by #128
Closed

Realtime allows multiple subscriptions to table #127

GaryAustin1 opened this issue Dec 31, 2021 · 3 comments · Fixed by #128
Labels
bug Something isn't working

Comments

@GaryAustin1
Copy link

Bug report

Documentations for realtime.js says:

Duplicate Join Subscriptions
While the client may join any number of topics on any number of channels, the client may only hold a single subscription for each unique topic at any given time. When attempting to create a duplicate subscription, the server will close the existing channel, log a warning, and spawn a new channel for the topic. The client will have their channel.onClose callbacks fired for the existing channel, and the new channel join will have its receive hooks processed as _normal.

Currently creating additional subscriptions to same table (or same table and exact filter) generate a new subscription.

To Reproduce

create multiple subscriptions to the same table and filter

Expected behavior

Based on the documentation, and I think the intent of the code, reusing a subscription should not create a new one.
I assumed it would so do not keep track of closing subscriptions when I renew.

This obviously can be handled by keeping track of subscriptions and closing them, but is a waste if realtime.js is supposed to handle it.
When dealing with connections going online and offline part of my code restarts subscriptions as part of a bigger block of code to reload the data being monitored in realtime as it state is no longer valid if connection goes offline.

Screenshots

realtime connections

duplicate connections on socket

System information

supabase 1.29.1

Additional context

Add any other context about the problem here.

@GaryAustin1 GaryAustin1 added the bug Something isn't working label Dec 31, 2021
@w3b6x9
Copy link
Member

w3b6x9 commented Jan 12, 2022

@GaryAustin1 thanks for reporting this! this is most likely a bug. i'm currently investigating.

@w3b6x9
Copy link
Member

w3b6x9 commented Jan 15, 2022

@GaryAustin1 can you please give this fix a try? #128

@GaryAustin1
Copy link
Author

Thanks, I'll try it in the morning...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants