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 |
---|---|---|
.. | ||
filter | Loading commit data... | |
pipeline | Loading commit data... | |
reference_parser | Loading commit data... | |
cross_project_reference_spec.rb | Loading commit data... | |
filter_array_spec.rb | Loading commit data... | |
issuable_extractor_spec.rb | Loading commit data... | |
note_renderer_spec.rb | Loading commit data... | |
object_renderer_spec.rb | Loading commit data... | |
querying_spec.rb | Loading commit data... | |
redactor_spec.rb | Loading commit data... | |
renderer_spec.rb | Loading commit data... |