User can double-award emoji
Summary
I can double-award an emoji with a numerical value.
Steps to reproduce
- Identify a comment where you have awarded an emoji with a numerical name (e.g.
1234
) - Click on the emoji again
- Instead of untoggling it, it awards it again (and toggles it normally thereafter)
Example Project
Here is a comment where this happens:
gitlab-com/www-gitlab-com!42790 (comment 304676812)
What is the current bug behavior?
Instead of toggling off, the emoji is awarded again - so a user can award it twice.
What is the expected correct behavior?
- The emoji should not be awarded more than once for a single user
- The emoji should award only if it has not already been awarded by that user
Relevant logs and/or screenshots
Before toggle:
After toggle:
Request to toggle_award_emoji
was 200, with the following payload:
I think this only happens with numerical emoji.
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)