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

Documentation mentions requirement to resubscribe upon reconnection #126

Open
Craig-J opened this issue Mar 6, 2023 · 2 comments
Open

Comments

@Craig-J
Copy link

Craig-J commented Mar 6, 2023

Last paragraph here mentions:

Beware that you need to resubscribe to channels after reconnection happens. You should subscribe to ReconnectionHappened stream and send subscription requests.

In my experience this seems to be untrue - I am continuing to get events from all of ReconnectionHappened, DisconnectionHappened and MessageReceived after a reconnection. Am I misunderstanding the situation where you must subscribe again or are the docs wrong?

If required to answer you can see the code I've written here.

@jjxtra
Copy link

jjxtra commented May 16, 2023

Seems like docs are wrong, in either case having to resubscribe seems like an error in architecture, since the inner socket is being handled separately, the subscribe is an abstraction over the background processing/handling of the web socket.

@Marfusios
Copy link
Owner

Sorry, the documentation is a little misleading.
By "channels" here, we mean subscriptions/groups on the server side.
Every websocket server solves it differently.

So inside ReconnectionHappened stream, you should send requests again, e.g.:

client.ReconnectionHappened.Subscribe(info =>
    {
         client.Send("{ type: subscribe, kind: something}"); // json/text, whatever the server expects
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants