Page MenuHomePhabricator

Support multiple pages in API:Delete
Open, Needs TriagePublicFeature

Description

API:Delete currently only supports a single page title in title, or a single page id in pageid. It should support specifying multiple pages by either method, and ideally also by providing one of the standard generators (which would let PRP provide a generator for Page: pages that could be fed to API:Delete).

On the Wikisourcen the "atomic unit" is not "an article" (singular) like on Wikipedia, but "a work" (a book, magazine, journal, newspaper, etc.). In terms of on-wiki artefacts, a "work" may consist of hundreds or even thousands of mainspace wikipages such as "War and Peace", "War and Peace/Chapter 1", "War and Peace/Chapter 2", etc. For some works this can be multiple levels of subpages totalling in the thousands. In addition, works on Wikisource are usually proofread (transcribed) from a scan of the original publication using the Proofread Page extension. This extension manages wikipages in the Page: namespace where each wikipage corresponds to one (scan of a) page in the physical book, meaning there is one Page:-namespace wikipage for each page in a possibly several thousand page book.

The net result is that when a work needs to be deleted (as copyvio or whatever), there may be as much as a thousand wikipages to delete from a single deletion discussion that on, e.g., a Wikipedia would be a single wikipage.

To deal with this we currently use a Gadget that serialises the API calls. Given the latency of each API call this is a pretty slow process, and the code is a bit brain-explody to deal with (a function-factory function generates nested $.Deferred functions for async API calls).

If we could instead specify either a whole batch of pages in a single call it would reduce the complexity to total / batchsize calls, and for the cases where we have a natural generator (a category or whatever) it'd be even simpler. And in all cases, any 'n>1' would dramatically reduce roundtrips, latency, and overhead (and time I need to spend looking at a "deleting page n of m" progress ticker).