I think I found a bug :(

When I psubscribe to a pattern (like news. from Redis website example) and specifically unsubscribe to news.foo, the client will still receive the message to news.foo, I tried different variations of foo and foo as shown below.

1585459154.068848 [0 172.17.0.1:35354] "psubscribe" "news." 1585459154.068915 [0 172.17.0.1:35354] "punsubscribe" "news.foo" 1585459154.068995 [0 172.17.0.1:35354] "punsubscribe" "news.foo" 1585459154.069005 [0 172.17.0.1:35354] "unsubscribe" "news.foo" 1585459154.069061 [0 172.17.0.1:35354] "unsubscribe" "news.foo"

127.0.0.1:6379> publish news.foo blah (integer) 1 127.0.0.1:6379> publish news.bar blah (integer) 1 127.0.0.1:6379>

Comment From: antirez

Hi, no bug, if you subscribe to a pattern, you can only unsubscribe to that exact pattern, identical to what you subscribed to.

Comment From: gittyup2018

Thanks for the quick reply, and making Redis of course!

Is there a way to do what I need then? subscribe to every pattern except 1+ specific channel(s)? would that be a feature request? because I really need that, it would save alot of bandwidth also..

Use case:

If I'm subscribed to a channel and publish to the same channel, I thought of adding a id to the end and just unsubscribing to that, so I wouldn't receive the data I just sent, but apparently it doesn't work that way?

SUBSCRIBE news.* UNSUBSCRIBE news.foo PUBLISH news.foo "this is one way message"