[Mediawiki-api] [Mediawiki-api-announce] BREAKING CHANGE: Queries may return fewer results than the limit and still set a query-continue

Brad Jorsch b-jorsch at northwestern.edu
Wed Feb 11 03:04:56 UTC 2009


I've been thinking about the case where you have two things trying to
continue. For example, prop=categories|templates.

Previously, you might have just kept replacing continue parameters until
you reach the end:

Q: prop=categories|templates
R: clcontinue=1&tlcontinue=1
Q: prop=categories|templates&clcontinue=1&tlcontinue=1
R: clcontinue=2
Q: prop=categories|templates&clcontinue=2&tlcontinue=1
R: 
-> done!

Or you could have ignored continue parameters that have already been run
to completion:

Q: prop=categories|templates
R: clcontinue=1&tlcontinue=1
Q: prop=categories|templates&clcontinue=1&tlcontinue=1
R: clcontinue=2
Q: prop=categories|templates&clcontinue=2
R: tlcontinue=1, but ignore it because we already did iistart
-> done!

But now, the continue parameters are not independent; depending on the
result size, one can restrict the other. So the first algorithm could go
like this:

Q: prop=categories|templates
R: clcontinue=1&tlcontinue=0
Q: prop=categories|templates&clcontinue=1&tlcontinue=0
R: clcontinue=2&tlcontinue=0
Q: prop=categories|templates&clcontinue=2&tlcontinue=0
R: tlcontinue=0
Q: prop=categories|templates&clcontinue=2&tlcontinue=0
R: tlcontinue=0
Q: prop=categories|templates&clcontinue=2&tlcontinue=0
-> loop forever

And the second like this:

Q: prop=categories|templates
R: clcontinue=1&tlcontinue=0
Q: prop=categories|templates&clcontinue=1&tlcontinue=0
R: clcontinue=2&tlcontinue=0
Q: prop=categories|templates&clcontinue=2&tlcontinue=0
R: tlcontinue=0
Q: prop=categories|templates&tlcontinue=0
R: clcontinue=1&tlcontinue=0, but clcontinue is ignored
Q: prop=categories|templates&tlcontinue=0
-> loop forever

To work right now, you need to remove property specifiers once you run
out of continues:

Q: prop=categories|templates
R: clcontinue=1&tlcontinue=0
Q: prop=categories|templates&clcontinue=1&tlcontinue=0
R: clcontinue=2&tlcontinue=0
Q: prop=categories|templates&clcontinue=2&tlcontinue=0
R: tlcontinue=0
** Remove revisions!
Q: prop=imageinfo&tlcontinue=0
R: tlcontinue=1
Q: prop=imageinfo&tlcontinue=1
R: 
-> done!

I just thought I'd mention this additional aspect to the breaking
change. The "new" algorithm is superior anyway, but its quite possible
people's bots are using one of the other two (mine was using the first
one, BTW).



More information about the Mediawiki-api mailing list