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

UNSUBSCRIBE from a unsubscribed channel doesn't trigger callback #738

Open
dlee-libo opened this issue Nov 28, 2019 · 2 comments
Open

UNSUBSCRIBE from a unsubscribed channel doesn't trigger callback #738

dlee-libo opened this issue Nov 28, 2019 · 2 comments
Assignees
Milestone

Comments

@dlee-libo
Copy link

The current implementation doesn't keep a callback for UNSUBSCRIBE command, the reason from the code base comments is that: every channel will receive an unsubscribe msg.
This design cause two problem:

  1. Callback passed with unsubscribe command never trigged.
  2. If the channel hasn't been subscribed, then we don't have a chance to handle related msg. As no callback for that channel yet.
@zuiderkwast
Copy link
Contributor

Was this solved by #1012?

@bjosv
Copy link
Contributor

bjosv commented Sep 2, 2022

#1012 didn't change how the pubsub handling was done from start for RESP2,
but it made sure unsubscribe in RESP3 works the same (no longer calling the registered push-callback).

It's correctly stated in bullet 1 that an unsubscribe response will call the subscribe-callback given when starting the subscription, i.e it's not using the callback given when sending the unsubscribe message.

..and in bullet 2 that sending an unsubscribe for a channel not subscribed to will not trigger any subscribe-callback, nor the given callback when sending the unsubscribe. (Sending an unsubscribe with no subscriptions at all will result in a REDIS_ERR)

I guess this would be a breaking change and probably needs some detailed reasons and benefits.

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

4 participants