What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 131 Stack Exchange communities.

On SO just now, I tried to edit a comment after the 5 minutes was up. Instead of the normal "You cannot edit a comment after 5 minutes" message, I got a "Cannot edit a comment more than every 5 seconds" message.

The revision on the bottom of the page was: 2012.4.12.2218

share|improve this question
    
Has the Stack Exchange devs changed the build numbers now? –  Benny Apr 13 '12 at 7:11
    
.replace("/edit/ig","vote") –  Manishearth Apr 13 '12 at 7:11
    
@Manishearth: you could be right; now I've got to go an find a page with a comment that's less than 5 minutes old, wait for the 5 minutes to expire, and then attempt to edit it. –  Jonathan Leffler Apr 13 '12 at 7:14
    
Interesting, even though the build number hasn't changed, neither here on Meta nor on SO can I reproduce the problem now. I don't know what other odd circumstance triggered the message (if that was what happened and whether the problem is still reproducible) or if there was a surreptitious fix without changing the release version number, or whether I'm just hallucinating and it's past bedtime (or all of the above). –  Jonathan Leffler Apr 13 '12 at 7:23
1  
@Benny A while ago, yes. We switched from CruiseControl.NET to TeamCity, and we also changed the build setup there once. –  balpha Apr 13 '12 at 7:58

1 Answer 1

up vote 11 down vote accepted

What I can see in the server access logs is that your browser submitted the comment edit multiple times (simultaneously). The first submission returned the "too late to edit" error; the subsequent submissions were then throttled, because you can only submit once every five seconds.

Since only the latest error message is displayed, the "too late to edit" error popup just existed for a split second, only to be immediately replaced by the "slow down, cowboy" error.

This sounds a lot like multiple event handlers being bound, each doing the same thing. And I have indeed found a way to cause this; maybe you can confirm that this is what happened:

When you start editing a comment, then cancel, then start editing again, this would each time bind another event handler that will eventually submit an edit to the server. I assume you had cancelled a previous edit to the comment before restarting to edit?

This has probably happened to lots of people over time; as far as I can see, this bug has existed ever since comment editing was enabled in December of 2009. This just got unnoticed because a) edit/cancel/edit is probably rare, and b) if the first edit submission is successful (which would be the usual case), the full comment thread is removed and replaced with the updated version, and since the error messages DOM-wise are descendents of the comment list, they get removed alongside, and thus weren't noticed.

This event handler rebinding is fixed in the next build.

share|improve this answer
    
Yes, I was having issues with the comment; I could easily have cancelled an edit and then re-edited. I didn't spot the 'too late' error, but I may not have been watching carefully enough. As so often, I wasn't really paying attention to what I was doing until the problem started, and by then it was too late to recall exactly what I'd done. Thanks for investigating and fixing. I hope you feel the obscure bug uncovered was worth fixing. –  Jonathan Leffler Apr 13 '12 at 9:23
    
I confirmed your finding with a cancelled edit then a re-edit and let time out expire on the comment above. Yes; you're right. –  Jonathan Leffler Apr 13 '12 at 9:42
    
"I didn't spot the 'too late' error" -- it may never have been visible; we're talking about milliseconds here. Thanks for confirming. –  balpha Apr 13 '12 at 9:48
1  
You should actually change the error text to "slow down, cowboy". Someone's gotta keep up with waffles in the "interesting error text" department =) –  jadarnel27 Apr 13 '12 at 12:18

You must log in to answer this question.

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