Premature submitting of post on paste after newline

(Apparently Archetype) #1

Reproduction steps:

  1. get some data on your clipboard. any old data will do,
  2. start a post in discourse.
  3. In rapid succession press ENTER ENTER CTRL+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.

(Sam Saffron) #3

@techAPJ I thought we removed all crazy shift-enter handling from wmd.

(Kane York) #4

This is ctrl-enter, not shift-enter.

(Sam Saffron) #5

I can not repro this, I tried quite a few times, what browser is this?

(Kane York) #6

I tried too, feels like it’s probably a timing issue and would only show up under load or on certain hardware.


Between me and @accalia, we’ve covered at least half a dozen keyboards across a similar number of machines, and on Chrome, Firefox, and IE.

You have to be really quick to trigger it :wink:

(Apparently Archetype) #8

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:

i7 32GB ram SSD (Windows 8.1)
i3 8GB ram SSD (Windows 8)
Celeron 4GB RAM HDD (Windows 7)
i5 Surface (Windows 8.1)
Chromebook Pixel 2015 (Chrome OS)
Phenom x6 6GB ram HDD/SSD (Windows 7)

also this. unless the site/editor is responding sluggishly you have to be really really fast to trigger it.

(Mittineague) #9

“really really fast” is relative. How fast are you talking in terms of actual seconds?


I can do it reliably in about one or two tenths of a second; just did it about 10 times while working that out

(Apparently Archetype) #11

yeah, that sounds about right.

as i mentioned it gets easier when the site is under load and acting sluggish

(Alan Tan) #12

@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.


(Jeff Atwood) #13