Page MenuHomePhabricator

R5. Flow uses synchronous XMLHttpRequests (VE+Flow)
Closed, ResolvedPublic2 Estimated Story Points

Description

Flow uses a synchronous XMLHttpRequest. These should be avoided since it blocks waiting for a network response, and can create a bad UX.

For this reason, it's been actively deprecated in recent Firefox (30+), when used on the main thread (https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest), and will log a warning.

It is used in mw.flow.parsoid.convert. This in turn is called twice, both from ext.flow.editor.js:

  1. mw.flow.editor.load - https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FFlow/a4eda372ccbd733ff741d3e1369c25a1e561fcf0/modules%2Feditor%2Fext.flow.editor.js#L88 - This is using promises already, so it should be straightforward to use an async call here.
  1. mw.flow.editor.getContent - https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FFlow/a4eda372ccbd733ff741d3e1369c25a1e561fcf0/modules%2Feditor%2Fext.flow.editor.js#L88 - This is synchronous, and used by FlowBoardComponent.UI.events.globalApiPreHandlers.prepareEditor. For this one, it also seems like it would be better to do the HTML->wikitext conversion on the server if possible, rather than round-trip a XHR call then post.

Version: master
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:51 AM
bzimport set Reference to bz71474.
bzimport added a subscriber: Unknown Object (MLST).
EBernhardson set Security to None.
EBernhardson moved this task from Untriaged to Team discussion on the Collaboration-Team-Triage board.
DannyH renamed this task from Flow uses synchronous XMLHttpRequests to Flow uses synchronous XMLHttpRequests (VE+Flow).Feb 25 2015, 9:10 PM
DannyH renamed this task from Flow uses synchronous XMLHttpRequests (VE+Flow) to R5. Flow uses synchronous XMLHttpRequests (VE+Flow).Feb 25 2015, 9:14 PM

Change 194871 had a related patch set uploaded (by Matthias Mullie):
Get rid of synchronous ajax calls

https://gerrit.wikimedia.org/r/194871

Change 194871 merged by jenkins-bot:
Get rid of synchronous ajax calls

https://gerrit.wikimedia.org/r/194871