Downstream: https://phabricator.wikimedia.org/T96464
Setup:
- A user is @mention'd in a description field (for example, a task description)
- They unsubscribe from the task.
- The description field is edited to correct a typo, unrelated to the mention.
This should not re-notify or re-add the user: only newly introduced mentions should trigger mention behavior. If the text already mentioned the user, the mention should not be re-evaluated on edit.
I plan to resolve this by doing this:
- Compute all old mentions in the text.
- Compute all new mentions in the text.
- Remove old mentions from the new mention list.
- Move forward from there.
In particular, this means that @mentioning a user in a new comment will re-add them. I think this is expected/desirable: you're explicitly calling them back to the task.
Closely related: editing comment should have the same behavior as editing descriptions (evaluate only new mentions).
Related downstream: https://phabricator.wikimedia.org/T76993
If a user is quoted, I think it's reasonable that it shouldn't count as a mention (specifically: @username invocations inside of a quote block do not count as mentions). This may be more trouble to resolve than it's worth, though, since the "mention" part of the code and the "quote" part of the code are fairly oblivious to one another, but I think it's generally reasonable and some straightfoward approach may be available.