12

If you start writing a comment, but then decide otherwise and leave it there, the comment will get posted upon your leaving the page - but only if the page is being left through entering a new address in the URL. If you click a link, or the "back" button, it won't happen.

Happens in Chrome on OS X. The bug has persisted for months so the version should not matter. Doesn't seem to happen in Firefox and Safari.

Does this have to do with one of these new-fangled URL/history APIs? No idea.

Steps to reproduce:

  1. Start writing a comment somewhere on a SE site. (Tested on Meta and SO.)

  2. Make sure the comment is long enough to be submitted.

  3. Don't submit it, but leave the page by entering a URL in the address bar.

  4. The comment you started will get posted while you leave the page.

This has been bugging me for months and I always thought it was just me not paying attention.

It's not terribly grave, but weird enough. Plus it can lead to awkward situations if a comment gets posted that you didn't want posted after all. Also I'd be curious to learn what's causing it!

  • Hmmm, I just tried.... I don't see my comment I typed in before entering stackoverflow.com in the address bar and pressing enter... – jmort253 Mar 15 '14 at 20:32
  • But what I do see, while I'm moving to the new site, is the add comment button switches to the "pressed" state. It seems that since you can press "enter" to add your comment, the act of pressing enter in the address bar fires that keypress event in the text box. I bet if I hit a delay in loading the next page, my comment would be submitted. However, Stack Overflow is faster than the time needed to submit my comment. Does this happen more if you visit slower sites from Stack Exchange, or does it happen everywhere? – jmort253 Mar 15 '14 at 20:35
  • 1
    Can you try installing SOUP and see if the fix it includes for this related bug fixes this one as well? – Ilmari Karonen Mar 16 '14 at 20:32
  • @Ilmari it appears to be fixed! – Pëkka Mar 17 '14 at 12:52
  • @blahdiblah I was referring to Ilmari's patch, though, not Chrome itself. Is it not working for you with the patch? – Pëkka Mar 17 '14 at 19:02
  • @Pëkka Oops, my mistake. Sorry 'bout that. – blahdiblah Mar 17 '14 at 19:06
8

It's a fairly significant lingering bug in Chrome which can actually be exploited in an obnoxious way.

I can't reproduce this in Chrome 35 (dev) on Windows*, so it's possible that it's been addressed in a revision that will hit stable channel sometime in the near future…that, or I'm just lucky to always win the race condition on this machine.

Browser bugs aside, this is why the comment handler should really stop responding to keyup, as doing so would just avoid these kinds of situations in the first place.

*I can reproduce the issue on Chrome 33 on OS X, though

  • Very interesting (and an unexpected source for the bug - I'd have bet it's SE's problem.) Thanks! – Pëkka Mar 15 '14 at 16:04
  • 3
    @Pëkka Yeah, fixing it on SE's end still seems like the sane thing to do regardless though, can't let those devs start to slack off. – Tim Stone Mar 15 '14 at 16:09
  • Slackers gonna slack. – Tim Post Mar 17 '14 at 12:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .