A bug has been reported where a post is submitted prematurely when pressing <kbd>ENTER</kbd>, <kbd>ENTER</kbd>, and CTRL+V` in rapid succession. The expected result is for two carriage returns to be entered and the clipboard content to be pasted into the editor. However, the post is submitted without the pasted content.
accalia initially reported the issue, and RaceProUK confirmed that it is tricky to reproduce, but reliably happens when pressing the keys quickly. sam and riking discussed the possibility of a timing issue, and sam was unable to reproduce the issue.
accalia provided a detailed list of tested configurations that exhibit the issue, including various keyboards, hardware, and browsers. Mittineague asked for clarification on the speed required to trigger the bug, and RaceProUK reported that he can reliably reproduce it in about one or two tenths of a second.
tgxworld was also able to reproduce the issue, but noted that it requires pressing the keys at a rate that is unlikely to occur in normal use. He also observed that at a slower pace, the “Post cannot be empty” alert is raised, indicating that there was an attempt to submit the post.
get some data on your clipboard. any old data will do,
start a post in discourse.
In rapid succession press ENTERENTERCTRL+v to past contents in new paragraph
Expected result: two carriage returns are entered and the clipboard content is pasted into the editor
Actual result: If you were fast enough on that trigger the post will be submitted without the pasted content.
I suspect this is because discourse is handling the CTRLENTER keyboard shortcut incorrectly. Probably by asking “is the CTRL button pressed now?” when processing an enter key, rather than asking the key event directly if any buckybits were set when the key was pressed.
It’s tricky, but fairly reliably reproducible; it’s all down to how quickly you press the keys. The quicker you do it, the more likely you’ll trigger the bug.
primarily Chrome, i’ve also gotten IE and Firefox to do it.
It’s much easier to reproduce when the site is having one of its slow moments, which is much more common on my home forum that it is here on meta.d. i have been able to reproduce it at steady state as well.
Tested configurations that exhibit the issue:
Membrane and mechanical keyboards (i have machines with both types and both types exhibit the bug.)
Logitech G710+ (mechanical)
Surface Pro 2 Type cover (membrane)
Logitech G510s (membrane)
Logitech K800 (membrane)
laptop keyboards (membrane, no known manufacturer other than “Google” and “HP”)
Hardware (CPU, Ram size and hard drive type) reproducable on:
@accalia I’m able to repro this but in order to do so I have to really press the keys are a rate that I feel like no normal user would do. At that speed I’m pretty sure I’m hitting ctrl+v+enter at some point.
However, I did realized that if you go at a somewhat slower pace it raises the Post cannot be empty alert which means that there was an attempt to submit.