# Change category "tracking" subscription to "watching" if I post a reply

**URL:** https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958
**Category:** Support
**Created:** [April 14, 2017, 1:31am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958 "2017-04-14T01:31:06Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![nordize](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nordize](https://meta.discourse.org/u/nordize)
#### Post date: [April 14, 2017, 1:31am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/1 "2017-04-14T01:31:06Z")

</div>

I’d like the following behavior, but don’t know if it’s possible. I have a “tracking” subscription for a certain category, so I get an email when a new topic is made. I reply in some topics, but not all. I would like to start receiving emails for all replies once I reply in a topic that isn’t mine. Currently, I don’t. I have to check the topic manually, or manually change my subscription to “watching”.

On other forum software that is normal behaviour (emails on every reply after I posted a reply, but not before). Is that possible on Discourse?

I’m running 1.8.0.beta10+57.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [April 14, 2017, 1:33am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/2 "2017-04-14T01:33:30Z")

</div>

Have you checked your User Preferences?  
 ![](https://global.discourse-cdn.com/meta/original/3X/2/e/2eea096f2ea6dd8289fdda6db08704bb6ceddc05.png)

---

<div class="post-metadata">

### Author: ![nordize](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nordize](https://meta.discourse.org/u/nordize)
#### Post date: [April 14, 2017, 1:44am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/3 "2017-04-14T01:44:24Z")

</div>

Yes, that is already set. Something else must be going on then (emailing works fine, tons of notifications for other events).

Does the fact that I set the category on “Tracking” affect it?

---

<div class="post-metadata">

### Author: ![nordize](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nordize](https://meta.discourse.org/u/nordize)
#### Post date: [April 14, 2017, 1:52am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/4 "2017-04-14T01:52:22Z")

</div>

I did another test in a category which I have on “Tracking”. Created a new topic from the API using the “system” user. The topic is set as “Tracked”. Then I posted a reply. The topic remained as “Tracked” (did not change to “Watching”).

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [April 14, 2017, 1:52am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/5 "2017-04-14T01:52:40Z")

</div>

Yup, that seems to be the case in my sandbox. If I have the category as Normal, it works, but once you set it to Tracking, it fails to change the topic subscription to watching.

---

<div class="post-metadata">

### Author: ![nordize](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nordize](https://meta.discourse.org/u/nordize)
#### Post date: [April 14, 2017, 1:53am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/6 "2017-04-14T01:53:22Z")

</div>

That doesn’t sound like expected behaviour, right?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 14, 2017, 1:55am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/7 "2017-04-14T01:55:33Z")

</div>

Once a user changes the notification level manually it is never overridden. The idea being the user wanted it that way when they set it.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [April 14, 2017, 2:02am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/8 "2017-04-14T02:02:18Z")

</div>

And if you wanted to see the code, this is where it is done.

> <https://github.com/discourse/discourse/blob/main/app/models/topic_user.rb#L40-L52>

The `TopicUser.where` is returning an item, thus it isn’t changing the notification.

You can also see more about said feature in this PR (so you can see how it trickles down to the `auto_notification` definition.  
[https://github.com/discourse/discourse/pull/4477/commits/6f1c31d777b5b8817baa29e396cc3c0d646e54fa](https://github.com/discourse/discourse/pull/4477/commits/6f1c31d777b5b8817baa29e396cc3c0d646e54fa)

---

<div class="post-metadata">

### Author: ![nordize](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nordize](https://meta.discourse.org/u/nordize)
#### Post date: [April 14, 2017, 2:16am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/9 "2017-04-14T02:16:15Z")

</div>

But, firstly, the two options are conflicting … I also set the option to switch to “watching” all topics where I reply. Then, secondly, it seems it is impossible to achieve what I described in my 1st post, which I deem normal behavior, i.e. notify on first post, and then notify on all replies **iff** I reply. That is what the two options sound like they should be doing (set category to “tracking” and the auto-swiytch to “watching” on reply).

We are a small-medium size team that relies on both those features. Are you saying that this behavior will not be changed and it won’t be possible?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 14, 2017, 2:28am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/10 "2017-04-14T02:28:38Z")

</div>

Not unless you set it manually on the topic. That is not really the case here

- you set the category to tracking, so the default state is to track for every topic in that category

- when you reply you have the pref set to watch on reply

Neither of those is a manual setting of the notification level so this should work. If it does not it is a bug. Any ideas @cpradio?

---

<div class="post-metadata">

### Author: ![nordize](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nordize](https://meta.discourse.org/u/nordize)
#### Post date: [April 14, 2017, 2:32am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/11 "2017-04-14T02:32:13Z")

</div>

Surely, the auto-switch to “watching” on reply should take precedence … it’s the more natural thing to expect. Manually replying in a particular topic means a deliberate action taken upon a single item. This is carries more significance (takes precedence) over what was set as “default state” for the category (i.e. the set of all topics). I would want to manually set it back to tracking once it switches to “watching” if I no longer want it, not the other way around.

Or add a checkbox at the bottom of the post edit box when replying that is by default _checked_ if the “auto switch to watching” is enabled, and _unchecked_ if the “auto switch to watching” is disabled … then it’s easier to handle. This is the same as the “subscription” checkbox that other forum software have near the “submit” button in the post edit box.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [April 14, 2017, 2:38am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/12 "2017-04-14T02:38:19Z")

</div>

Yup, topic state is getting set at visit to the topic.

**Here is my test:**

1. As a normal user, set a category to Tracking
2. As another user, create a topic in said category
3. Using [Data Explorer](https://meta.discourse.org/t/32566?silent=true), query the `topic_users` table for newly created topic to see what users have a subscription state on it.
4. Validate that only user with a subscription is the topic owner
5. Visit the topic as the user from step 1
6. Immediately re-run [Data Explorer](https://meta.discourse.org/t/32566?silent=true) query in step 3
7. Two users now have a topic state for the topic (the user from step 1 and from step 2) **– this is the culprit**
8. Reply to topic
9. Topic state does not change because user has a subscription state for the given topic.

**Other details:**

User for step 2 has the following preferences set:  
`Automatically track topics I enter` is set to 4 minutes. I did not wait 4 minutes on the topic when visiting. I waited less than 30 seconds before running the query, the topic state happens immediately

`When I post in a topic, set that topic to` is set to Watching.

`Tracked Categories` is appropriately set for the category being used in the test.

**Possible solution:**

Change the `auto_notification` method to look for a higher subscription state than what is being requested. In this case, the current state would be `tracking`, and the request would be `watching` so it should permit the change in state. Or in cases of the state being `normal` (not sure if this is possible) and the request being `tracking`, it should change it.

_Other considerations:_  
What should happen if the state is `muted` (meaning the user muted a category) and then they replied to a topic in the muted category? Should that topic’s state change?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 14, 2017, 4:44am UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/13 "2017-04-14T04:44:13Z")

</div>

> [@cpradio](#):
>
> Change the auto\_notification method to look for a higher subscription state than what is being requested. In this case, the current state would be tracking, and the request would be watching so it should permit the change in state. Or in cases of the state being normal (not sure if this is possible) and the request being tracking, it should change it.

This sounds good to me. I think the replying to a muted category topic case, they made their bed, now they get to lay in it 😉

---

<div class="post-metadata">

### Author: ![nordize](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nordize](https://meta.discourse.org/u/nordize)
#### Post date: [April 14, 2017, 12:35pm UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/14 "2017-04-14T12:35:35Z")

</div>

> [@nordize](#):
>
> Surely, the auto-switch to “watching” on reply should take precedence … it’s the more natural thing to expect. Manually replying in a particular topic means a deliberate action taken upon a single item. This is carries more significance (takes precedence) over what was set as “default state” for the category (i.e. the set of all topics). I would want to manually set it back to tracking once it switches to “watching” if I no longer want it, not the other way around.

I’m a little surprised at how you guys look at this. To me it makes total sense that if I reply anywhere, then the state of that topic **should** change to what I set my “auto\_switch on reply” to be, **especially** if it’s higher than what I set the category to be, including muted. If I’m replying anywhere, then most likely that is because I’m interested in the topic … I can always mute a topic back if I really no longer want to participate, which is statistically less likely.

Fine if you don’t see things this way. Could you please advise me on the simplest way for me to maintain a patch on my own install that’s easy to re-apply after upgrades? I’m still new to Discourse, be gentle please. We do need it on our install (I can explain why if you’re interested).

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 14, 2017, 12:43pm UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/15 "2017-04-14T12:43:13Z")

</div>

> [@nordize](#):
>
> I’m a little surprised at how you guys look at this. To me it makes total sense that if I reply anywhere, then the state of that topic should change to what I set my “auto\_switch on reply” to be

The way I read it, @cpradio and @codinghorror agree with you

> [@cpradio](#):
>
> Possible solution:  
> … In this case, the current state would be tracking, and the request would be watching so it **should permit the change in state**. Or in cases of the state being normal (not sure if this is possible) and the request being tracking, **it should change** it.

> [@codinghorror](#):
>
> This sounds good to me.

---

<div class="post-metadata">

### Author: ![nordize](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nordize](https://meta.discourse.org/u/nordize)
#### Post date: [April 14, 2017, 12:51pm UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/16 "2017-04-14T12:51:44Z")

</div>

Then I need more sleep or more coffee (or both).

> [@codinghorror](#):
>
> I think the replying to a muted category topic case, they made their bed, now they get to lay in it

To me that implied that if some category is set to muted then topics should not be bumped by the “auto\_switch on reply”.

I was arguing it should **always** change to whetever the “auto\_switch on reply” is set to (\*), even if the category is muted, because that event (replying) shows intent in a particular case, whereas the category setting is a default for all cases. The former should override the latter (not the other way around like it does currently).

(\*) when higher than the category setting

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [April 14, 2017, 6:19pm UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/17 "2017-04-14T18:19:35Z")

</div>

> [@nordize](#):
>
> Could you please advise me on the simplest way for me to maintain a patch on my own install that’s easy to re-apply after upgrades?

Fork Discourse, create a branch, make the change, submit change as a PR to Discourse. Point your instance to the branch in the meantime.

---

<div class="post-metadata">

### Author: ![nordize](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nordize](https://meta.discourse.org/u/nordize)
#### Post date: [April 14, 2017, 6:35pm UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/18 "2017-04-14T18:35:59Z")

</div>

> [@cpradio](#):
>
> Point your instance to the branch in the meantime.

How exactly do I point my Discourse install to my github fork branch? I presume some change to app.yml? (still new to Discourse)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [April 14, 2017, 6:43pm UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/19 "2017-04-14T18:43:54Z")

</div>

Honestly, I haven’t done that part a lot, but I imagine it is in web.template.yml, this part in particular.

I usually just wait for the PR to be merged (it doesn’t typically take a long time)

```plaintext
      cd: $home
      hook: code
      cmd:
        - git reset --hard
        - git clean -f
        - git remote set-branches --add origin master
        - git pull
        - git fetch origin $version
        - git checkout $version

```

---

<div class="post-metadata">

### Author: ![nordize](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nordize](https://meta.discourse.org/u/nordize)
#### Post date: [April 14, 2017, 6:58pm UTC](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958/20 "2017-04-14T18:58:53Z")

</div>

Makes sense. For now I’ll wait for you to implement it since you’ve done the previous feature too (I’m also not familiar with the Discourse code yet; also have little to no love for Ruby 😃)

[Next page](https://meta.discourse.org/t/change-category-tracking-subscription-to-watching-if-i-post-a-reply/60958.md?page=2)
