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

Replace old subscriptions with a new one instead of throwing an error #1630

Closed
dborovcanin opened this issue Jul 21, 2022 · 0 comments · Fixed by #1633
Closed

Replace old subscriptions with a new one instead of throwing an error #1630

dborovcanin opened this issue Jul 21, 2022 · 0 comments · Fixed by #1633
Assignees

Comments

@dborovcanin
Copy link
Collaborator

dborovcanin commented Jul 21, 2022

FEATURE REQUEST

  1. Is there an open issue addressing this request? If it does, please add a "+1" reaction to the
    existing issue, otherwise proceed to step 2.

No.

  1. Describe the feature you are requesting, as well as the possible use case(s) for it.

The implementation of the WS adapter in #1625 pointed out a different problem: What happens if the connection is closed and Unsubscribe fails? Since the connection is closed, there is no way for the client to call Unsubscribe anymore. And in the NATS (the default) implementation of the PubSub, trying to subscribe returns an error if the subscription already exists, leaving the client in the limbo state - it can't unsubscribe (the connection is broken) and there is no way to subscribe (the entry exists due to unsuccessful previous unsubscribe attempt).
The most straightforward workaround for this problem is to adopt the MQTT approach - Calling subscribe for the client that's already subscribed results in unsubscribe the old entry and creating a new subscription - effectively replacing the old subscription with the new one.

  1. Indicate the importance of this feature to you (must-have, should-have, nice-to-have).

This is a must-have because for protocols that support subscribing we can't rely on a connection to never break or calling Unsubscribe to never fail.

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

Successfully merging a pull request may close this issue.

2 participants