Updating long post quickly could result in post truncation
|Reported by:||archon810||Owned by:|
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.