Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#24161 closed defect (bug) (worksforme)

Updating long post quickly could result in post truncation

Reported by: archon810's profile archon810 Owned by:
Milestone: Priority: normal
Severity: critical Version: 3.5.1
Component: Editor Keywords:
Focuses: Cc:

Description

I've observed a bug yesterday when updating a 10,000 word post frequently while testing another feature. The last update ended up eating almost half of the post at the end and went unnoticed until today when it was pointed out by users.

I've examined the update history and indeed found the last update to not contain a good portion of the post - it just cuts off.

The only explanation I have for this behavior is that because the post is so long, the update button was pressed while the textarea field was still loading, which interrupted the loading process and submitted whatever was loaded at the time. This is very dangerous - a race condition like that could demolish long posts or posts on slower connections.

A solution here should be a validation function that makes sure the post was loaded before the Update button is clickable. Perhaps just tie the onload to the Update button so it's disabled until the browser confirms things are loaded. I'm open to other suggestions, but I'm now definitely scared of one of the authors or myself accidentally truncating content.

Change History (2)

#1 @knutsp
11 years ago

  • Cc knut@… added

#2 @azaozz
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Can't reproduce this in Firefox, Chrome or IE. The Update button cannot be clicked before the page is loaded. If the Visual editor is default, it is possible to click Update while TinyMCE is still loading but as the textarea content is part of the actual page HTML, it still gets submitted properly.

Feel free to reopen with steps to reproduce.

Note: See TracTickets for help on using tickets.