BigW Consortium Gitlab
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.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
base_parser_spec.rb | Loading commit data... | |
commit_parser_spec.rb | Loading commit data... | |
commit_range_parser_spec.rb | Loading commit data... | |
external_issue_parser_spec.rb | Loading commit data... | |
issue_parser_spec.rb | Loading commit data... | |
label_parser_spec.rb | Loading commit data... | |
merge_request_parser_spec.rb | Loading commit data... | |
milestone_parser_spec.rb | Loading commit data... | |
snippet_parser_spec.rb | Loading commit data... | |
user_parser_spec.rb | Loading commit data... |