Race condition allows closing ticket twice

A race condition in gitlab appears to allow closing a ticket twice.

To do so, the following steps are necessary:

  1. Enter text as a comment, and click "Comment and close" button
  2. While this is being processed, you may be presented with a "Close issue" button for a very brief amount of time which can be clicked if you're fast enough

Actual result: https://gitlab.com/tethercode/stdlib/issues/1 (two close events, email notificiations for closing sent twice, ..)

Expected result: Only first close is processed even if I manage to click the "Close issue" button that is incorrectly dipslayed for a very short moment.

Edited by Mark Fletcher