gitlab-org--gitlab-foss/spec/lib
Sean McGivern 172932eec8 Fix /unsubscribe slash command creating extra todos
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.
2017-05-30 11:24:55 +01:00
..
api/helpers
banzai Fix /unsubscribe slash command creating extra todos 2017-05-30 11:24:55 +01:00
bitbucket
ci Enable the Style/TrailingCommaInArguments cop 2017-05-10 18:25:45 +02:00
constraints Redirect from redirect routes to canonical routes 2017-05-05 12:11:57 -07:00
container_registry Properly handle container registry redirects to fix metadata stored on a S3 backend 2017-05-17 07:04:34 -07:00
gitlab Merge branch '30917-wiki-is-not-searchable-with-guest-permissions' into 'master' 2017-05-29 17:50:07 +00:00
json_web_token
mattermost Fix values being called at Array instead of Hash 2017-03-06 11:30:13 +01:00
microsoft_teams adds relevant tests 2017-04-06 19:47:07 +01:00
additional_email_headers_interceptor_spec.rb
disable_email_interceptor_spec.rb
event_filter_spec.rb
expand_variables_spec.rb Enable the Style/TrailingCommaInLiteral cop 2017-05-10 18:25:45 +02:00
extracts_path_spec.rb
file_size_validator_spec.rb
gitlab_spec.rb
repository_cache_spec.rb