Last modified: 2014-02-19 22:27:02 UTC
Parsoid was restarting and so [Preview] was slow and I clicked more than once. I noticed in Firebug that the api requests continued, several were in flight to preview the same post. You can simulate this by adding sleep( rand( 0, 10 ) ); to execute() in includes/api/ApiParsoidUtilsFlow.php then click [Preview] multiple times, then click Cancel. All the preview requests continue. It would be less server and client, especially when Parsoid is slow, if clicking Preview, Cancel, or Reply cancelled any existing api.post() request for preview of the same post, if any. You save the jqXHR from api.post(), and call abort() on it before sending the new one. (And in failure, check for data.status = 'abort' before alerting.) The good news is it seems the client waits for the last jqXHR to arrive, so you never see a preview of an earlier state.
The WMF core features team tracks this bug on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/596, but people from the community are welcome to contribute here and in Gerrit.