How does Mute interact with other subscription types in the official slack plugin?

AI-generated summary

In a discussion about the official Slack plugin for Discourse, mcwumbly asks how the mute command interacts with other subscription types like watch, particularly when multiple conflicting settings exist (e.g., muting all categories while watching specific ones). vinothkannans confirms that mute currently overrides other settings, which may lead to unintended behavior — for example, a post in a watched category might still be muted if “All categories” is muted. They suggest adding a command to explicitly unwatch, unfollow, or unmute specific tags or categories to resolve this. Additionally, they propose modifying the plugin’s logic to exit early when a mute filter is encountered, rather than continuing to evaluate subsequent rules — referencing this code condition — to prevent messages from being incorrectly sent. The issue highlights a need for clearer precedence rules and more granular control over Slack subscriptions via command-line interface.

With the official slack plugin, when you do the following, it’s not clear what behavior to expect:

/discourse watch foo
Watched category foo

/discourse watch bar
Watched category bar

/discourse mute all
Muted all categories on this channel

At this stage, the admin plugin settings show three rows:

  1. Foo, #my-channel, All posts and replies
  2. Bar, #my-channel, All posts and replies
  3. All categories, #my-channel, Muting

When in this state, what should happen when a post is made in the Foo category?

If Mute overrides other settings, than I think I want to be able to “Unmute” All categories in this example (or maybe more generally delete a particular subscription from the slack command)

Alternatively, if the settings were:

  1. Bar, #my-channel, Muting
  2. All categories, #my-channel, All posts and replies

What should happen when a post is made in the Bar category?

As per my understanding of existing message sending code

Yes. Mute overrides other settings.


I guess we should have something like below


May be we have problem here. It may still send message to #my-channel.

I think we should come out from loop instead of moving to next record in this condition. Particularly when i[:filter] == 'mute'. Am I right @tgxworld?