Last modified: 2014-11-04 20:23:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T73389, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 71389 - action=query&list=deletedrevs with a new-style continuation fails
action=query&list=deletedrevs with a new-style continuation fails
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.24rc
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-28 11:42 UTC by orlodrim
Modified: 2014-11-04 20:23 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description orlodrim 2014-09-28 11:42:13 UTC
When I call action=query&list=deletedrevs&titles=... with the new mode for continuation (continue=) and there are more results than the limit and drstart is set, the second query fails. If drstart is not set, the result of the second query sometimes contain deleted revisions of another page.

== Examples ==
You need to be a sysop on frwiki to see the results.

First query:
https://fr.wikipedia.org/w/api.php?action=query&list=deletedrevs&titles=Utilisateur:Orlodrim/R%C3%A9f%C3%A9rences%20incorrectes&drprop=user&drstart=2013-11-30T14:25:56Z&drlimit=1&continue=
Result:
Information on one deleted revision as expected + the following tag for continuation:
<continue drcontinue="2|Orlodrim/Références_incorrectes|20131128195552|6069941" continue="-||" />

Second query:
https://fr.wikipedia.org/w/api.php?action=query&list=deletedrevs&titles=Utilisateur:Orlodrim/R%C3%A9f%C3%A9rences%20incorrectes&drprop=user&drstart=2013-11-30T14:25:56Z&drlimit=1&continue=-||&drcontinue=2|Orlodrim/R%C3%A9f%C3%A9rences_incorrectes|20131128195552|6069941
Result:
<error code="drbadparams" info="The start parameter cannot be used in mode 3" xml:space="preserve">

Expected result: no error and information about the next deleted revision of the same page.


If drstart is not set, there is no error, but the result is sometimes invalid:

Sequence that does not work (the second query returns a deleted revision of https://fr.wikipedia.org/wiki/%F0%9F%9A%80):
1. https://fr.wikipedia.org/w/api.php?action=query&list=deletedrevs&titles=Utilisateur:Orlodrim/R%C3%A9f%C3%A9rences%20incorrectes&drprop=user&drlimit=1&continue=
2. https://fr.wikipedia.org/w/api.php?action=query&list=deletedrevs&titles=Utilisateur:Orlodrim/R%C3%A9f%C3%A9rences%20incorrectes&drprop=user&drlimit=1&continue=-||&drcontinue=2|Orlodrim/R%C3%A9f%C3%A9rences_incorrectes|20131208231758|6069944

Sequence that works:
1. https://fr.wikipedia.org/w/api.php?action=query&list=deletedrevs&titles=A-Live&drprop=user&drlimit=1&continue=https://fr.wikipedia.org/w/api.php?action=query&list=deletedrevs&titles=A-Live&drprop=user&drlimit=1&continue=
2. https://fr.wikipedia.org/w/api.php?action=query&list=deletedrevs&titles=A-Live&drprop=user&drlimit=1&continue=https://fr.wikipedia.org/w/api.php?action=query&list=deletedrevs&titles=A-Live&drprop=user&drlimit=1&continue=-||&drcontinue=0|A-Live|20081002173128|5600890

== Investigation ==

I noticed that if the "continue" parameter is equal to "-||", $generatorDone is set to true in ApiQuery::execute(), so mPageSet is not initialized. Because of that, ApiQueryDeletedrevs is in mode 3 ("List all deleted revisions in the given namespace") instead of mode 1 ("List deleted revisions for the given title"). If I manually replace "-||" with "||" in the "continue" parameter, the second query works.

ApiResult::endContinuation() sets "continue" to "-||" if "Generator and prop modules are all done". I believe that the root cause is the incorrect assumption that "action=query&list=..." never makes use of the "titles" parameter.

However, I do not understand why it does not consistently fail without "drstart".
Comment 1 Brad Jorsch 2014-09-29 13:42:06 UTC
The root cause here is that "list=deletedrevs" is pretending to be a "prop" module when it's actually not. The new-style continuation doesn't know it's pretending to be a prop module, so it doesn't set the continuation fields correctly.

I'm inclined to deprecate list=deletedrevs using the pageset at all, and instead add all three of "drtitles", "drpageids", and "drrevids" to make it more like all other 'list' submodules. I'll have to check whether anyone is using list=deletedrevs with a generator though, as "drgenerator" would be insane. Or else make something like "prop=deletedrevisions" for mode 1 and "list=alldeletedrevisions" for modes 2 and 3, and deprecate list=deletedrevs entirely.
Comment 2 Brad Jorsch 2014-09-29 13:56:44 UTC
I added this to the list at https://www.mediawiki.org/wiki/Requests_for_comment/API_roadmap#Fix_list.3Ddeletedrevs for some further discussion.
Comment 3 Gerrit Notification Bot 2014-10-24 19:19:26 UTC
Change 168646 had a related patch set uploaded by Anomie:
API: Split list=deletedrevs into prop=deletedrevisions and list=alldeletedrevisions

https://gerrit.wikimedia.org/r/168646
Comment 4 Gerrit Notification Bot 2014-11-04 20:22:12 UTC
Change 168646 merged by jenkins-bot:
API: Split list=deletedrevs into prop=deletedrevisions and list=alldeletedrevisions

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links