mediawiki.api: Prevent misusing #saveOptions
authorBartosz Dziewoński <matma.rex@gmail.com>
Fri, 1 Feb 2019 22:23:30 +0000 (14:23 -0800)
committerBartosz Dziewoński <matma.rex@gmail.com>
Mon, 18 Feb 2019 17:37:28 +0000 (18:37 +0100)
commit1fd2d0716e12b0dcd4e7403c54d0534a1a679f56
tree9938f1f6748dca0bf291d24fec0d8c0fb842c78b
parent486a51c8d67a435f281bdbdd15c39904a13d2cdf
mediawiki.api: Prevent misusing #saveOptions

Task T214963 is about how we misused #saveOptions in VisualEditor and
made MediaWiki sad. I'm not sure whether we should fix the issues
there or here, but it seems like the mistakes would be easy to make in
other software, so let's try here first and see what folks think about
it.

* Do not send action=options API requests for IP users
* Wait for the previous request to finish before sending another

Bug: T214963
Change-Id: I85cfc6b5829bcd96e6245431cd979c24630a8fd8
resources/src/mediawiki.api/options.js
tests/qunit/suites/resources/mediawiki.api/mediawiki.api.options.test.js