A user can approve the same merge request multiple times
Summary
You can approve the same merge request multiple times if you click fast enough.
Steps to reproduce
- Navigate to the merge request you want to approve
pkill firefox -STOP
- Click on the 'Approve' button multiple times
pkill firefox -CONT
It also works through the API or by clicking really fast. A colleague wrote a script for this.
Example Project
Any project with MRs and approval.
What is the current bug behavior?
Clicking the button or calling the api to approve a MR fast enough approves the MR multiple times.
What is the expected correct behavior?
Clicking the button or calling the api to approve a MR fast enough should still only approves the MR once.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 2.4.4p296 Gem Version: 2.7.6 Bundler Version:1.16.2 Rake Version: 12.3.1 Redis Version: 3.2.11 Git Version: 2.17.1 Sidekiq Version:5.1.3 Go Version: unknownGitLab information Version: 11.0.4-ee Revision: 3350cd6 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.8 URL: http://10.100.0.1:8000 HTTP Clone URL: http://10.100.0.1:8000/some-group/some-project.git SSH Clone URL: git@10.100.0.1:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: no
GitLab Shell Version: 7.1.4 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab Shell ...GitLab Shell version >= 7.1.4 ? ... OK (7.1.4) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 2/1 ... ok 2/2 ... ok 2/3 ... ok 2/4 ... ok 2/5 ... ok 2/6 ... ok 2/7 ... ok 2/8 ... ok 2/9 ... ok 2/10 ... ok 2/11 ... ok 2/12 ... ok 2/13 ... ok 2/14 ... ok 2/15 ... ok 2/16 ... ok 2/17 ... ok 2/18 ... ok 2/19 ... ok 2/20 ... ok 2/21 ... ok 2/22 ... ok 2/23 ... ok 2/24 ... ok 2/25 ... ok 12/26 ... ok 12/27 ... ok 12/28 ... ok 12/29 ... ok 12/30 ... ok 12/31 ... ok 12/32 ... ok 12/33 ... ok 12/34 ... ok 12/35 ... ok 12/36 ... ok 12/37 ... ok 12/38 ... ok 12/39 ... ok 12/40 ... ok 12/41 ... ok 12/42 ... ok 12/43 ... ok 12/44 ... ok 12/45 ... ok 2/46 ... ok 12/47 ... ok 12/48 ... ok 12/49 ... ok 12/50 ... ok 12/51 ... ok 6/52 ... ok 6/53 ... ok 12/54 ... ok 12/55 ... ok 12/56 ... ok 12/57 ... ok 6/59 ... ok 6/60 ... ok 6/61 ... ok 12/62 ... ok 12/63 ... ok 1/64 ... ok 1/65 ... ok 12/67 ... ok 1/68 ... ok 8/69 ... repository is empty 12/70 ... ok 12/71 ... ok 6/72 ... ok 11/74 ... ok 2/75 ... ok 11/77 ... ok 7/78 ... ok 16/79 ... ok 2/80 ... ok 6/81 ... ok 11/82 ... ok 5/83 ... ok 2/85 ... ok 2/86 ... ok 8/87 ... ok 19/88 ... ok 19/89 ... ok 5/90 ... ok 1/91 ... ok 19/93 ... ok 2/94 ... ok 10/95 ... ok 2/97 ... ok 11/98 ... ok 2/99 ... ok 2/101 ... ok 2/102 ... ok 2/103 ... ok 26/104 ... ok 16/105 ... ok 2/109 ... ok 2/110 ... ok 2/111 ... ok 16/112 ... ok 2/113 ... ok 2/114 ... ok 5/116 ... ok 2/117 ... repository is empty 16/118 ... ok 2/119 ... ok 6/120 ... ok 5/121 ... ok 16/122 ... ok 2/123 ... ok 2/124 ... ok 6/125 ... ok 16/127 ... ok 2/128 ... ok 2/129 ... ok 5/130 ... ok 5/131 ... ok 6/132 ... ok 6/133 ... ok 6/134 ... ok 2/135 ... ok 2/136 ... ok 6/139 ... ok 2/140 ... ok 16/141 ... ok 2/146 ... ok 2/147 ... ok 2/148 ... ok 2/149 ... ok 6/150 ... ok 2/151 ... ok 2/152 ... ok 16/154 ... ok 16/155 ... ok 2/156 ... ok 2/158 ... ok 16/159 ... ok 35/160 ... ok 35/161 ... ok 2/162 ... ok 2/163 ... ok 23/164 ... ok 2/166 ... ok 2/167 ... ok 5/168 ... ok 2/169 ... ok 2/170 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Reply by email is disabled in config/gitlab.yml Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/1 ... yes 2/2 ... yes 2/3 ... yes 2/4 ... yes 2/5 ... yes 2/6 ... yes 2/7 ... yes 2/8 ... yes 2/9 ... yes 2/10 ... yes 2/11 ... yes 2/12 ... yes 2/13 ... yes 2/14 ... yes 2/15 ... yes 2/16 ... yes 2/17 ... yes 2/18 ... yes 2/19 ... yes 2/20 ... yes 2/21 ... yes 2/22 ... yes 2/23 ... yes 2/24 ... yes 2/25 ... yes 12/26 ... yes 12/27 ... yes 12/28 ... yes 12/29 ... yes 12/30 ... yes 12/31 ... yes 12/32 ... yes 12/33 ... yes 12/34 ... yes 12/35 ... yes 12/36 ... yes 12/37 ... yes 12/38 ... yes 12/39 ... yes 12/40 ... yes 12/41 ... yes 12/42 ... yes 12/43 ... yes 12/44 ... yes 12/45 ... yes 2/46 ... yes 12/47 ... yes 12/48 ... yes 12/49 ... yes 12/50 ... yes 12/51 ... yes 6/52 ... yes 6/53 ... yes 12/54 ... yes 12/55 ... yes 12/56 ... yes 12/57 ... yes 6/59 ... yes 6/60 ... yes 6/61 ... yes 12/62 ... yes 12/63 ... yes 1/64 ... yes 1/65 ... yes 12/67 ... yes 1/68 ... yes 8/69 ... yes 12/70 ... yes 12/71 ... yes 6/72 ... yes 11/74 ... yes 2/75 ... yes 11/77 ... yes 7/78 ... yes 16/79 ... yes 2/80 ... yes 6/81 ... yes 11/82 ... yes 5/83 ... yes 2/85 ... yes 2/86 ... yes 8/87 ... yes 19/88 ... yes 19/89 ... yes 5/90 ... yes 1/91 ... yes 19/93 ... yes 2/94 ... yes 10/95 ... yes 2/97 ... yes 11/98 ... yes 2/99 ... yes 2/101 ... yes 2/102 ... yes 2/103 ... yes 26/104 ... yes 16/105 ... yes 2/109 ... yes 2/110 ... yes 2/111 ... yes 16/112 ... yes 2/113 ... yes 2/114 ... yes 5/116 ... yes 2/117 ... yes 16/118 ... yes 2/119 ... yes 6/120 ... yes 5/121 ... yes 16/122 ... yes 2/123 ... yes 2/124 ... yes 6/125 ... yes 16/127 ... yes 2/128 ... yes 2/129 ... yes 5/130 ... yes 5/131 ... yes 6/132 ... yes 6/133 ... yes 6/134 ... yes 2/135 ... yes 2/136 ... yes 6/139 ... yes 2/140 ... yes 16/141 ... yes 2/146 ... yes 2/147 ... yes 2/148 ... yes 2/149 ... yes 6/150 ... yes 2/151 ... yes 2/152 ... yes 16/154 ... yes 16/155 ... yes 2/156 ... yes 2/158 ... yes 16/159 ... yes 35/160 ... yes 35/161 ... yes 2/162 ... yes 2/163 ... yes 23/164 ... yes 2/166 ... yes 2/167 ... yes 5/168 ... yes 2/169 ... yes 2/170 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.4.4) Git version >= 2.9.5 ? ... yes (2.17.1) Git user has default SSH configuration? ... yes Active users: ... 14 Elasticsearch version 5.1 - 5.5? ... skipped (elasticsearch is disabled)
Checking GitLab ... Finished
Possible fixes
Could be fixed any number of ways, up to you. A DB constraint might be the easy way but schema migration could be an issue in that case.