PR Submitted
https://github.com/discourse/discourse/pull/4811
Ok merged thanks @cpradio!
Unfortunately this fix isn’t right… it is now overriding in the case where
- user posts in topic
- user sets topic notification state to “normal”
- user posts again in the same topic
we have to disallow change if the notification state is normal … or muted, as @cpradio alluded to. Pardon the pseudocode but this might be the fix:
notifications_reason_id IS NULL OR (notification_level < ? AND notification_level > normal)
either
- user has not set a notification level for this topic
OR
- desired notification level is higher than current topic notification level AND current notification level is greater than normal
(the key to understanding this is that if we do have a notification level of normal that’s explicitly set in the DB, that absolutely came from the user, as normal is an assumed default all the time.)
Will submit a PR to do that shortly (and update the tests)
I believe @techapj is already working on it so I would hold off.
@cpradio fixed this via:
https://github.com/discourse/discourse/commit/2dccaff25d8697adb97c929c34321d98d349f34c