172932eec8
The /unsubscribe slash command means that we check if the current user is subscribed to the issuable without having an explicit subscription. That means that we use the UserParser to find references to them in the notes. The UserParser (and all parsers inheriting from BaseParser) use RequestStore to cache ActiveRecord objects, so that we don't need to load the User object each time, if we're parsing references a bunch of times in the same request. However, it was always returning _all_ of the previously cached items, not just the ones matching the IDs passed. This would mean that we did two runs through with UserParser if you were mentioned in a comment, and then mentioned someone else in your comment while using /unsubscribe: 1. Because /unsubscribe was used, we see if you were mentioned in any comments. 2. Because you mentioned someone, we find them - but we would also get back your user, even if you didn't mention yourself. This would have the effect of creating a mention or directly addressed todo for yourself incorrectly. The fix is simple: only return values from the cache matching the IDs passed. |
||
---|---|---|
.. | ||
api/helpers | ||
banzai | ||
bitbucket | ||
ci | ||
constraints | ||
container_registry | ||
gitlab | ||
json_web_token | ||
mattermost | ||
microsoft_teams | ||
additional_email_headers_interceptor_spec.rb | ||
disable_email_interceptor_spec.rb | ||
event_filter_spec.rb | ||
expand_variables_spec.rb | ||
extracts_path_spec.rb | ||
file_size_validator_spec.rb | ||
gitlab_spec.rb | ||
repository_cache_spec.rb |