Page MenuHomePhabricator

[Preview] doesn't abort api requests in flight
Closed, InvalidPublic

Description

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.


Version: master
Severity: minor

Details

Reference
bz58116

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:27 AM
bzimport set Reference to bz58116.
bzimport added a subscriber: Unknown Object (MLST).

bingle-admin wrote:

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.