API talk:Raw query continue

From MediaWiki.org
Jump to navigation Jump to search

Logic Problem or MediaWiki Bug?[edit]

I rather suspect the first, but if so, is it on my end or in the logic presented on the page? According to the logic on this page as I understand it, when I hit the generator's continue, I send the following and get the result below it:

Great, looks good so far. Then, I ask for the next block:

I trust the infinite loop is clear. :) – RobinHood70 talk 07:50, 14 January 2014 (UTC)

Never mind, I got it figured out. You have to keep emitting the same gclcontinue once you've first emitted it. That's not clear from the page; I'll go clarify it. – RobinHood70 talk 08:13, 14 January 2014 (UTC)
Thanks for the clarification. I suggest you switch to the new continue model, as it handles these issues automatically, and makes the client code much shorter and cleaner. --Yurik (talk) 08:29, 14 January 2014 (UTC)
A bit of a late reply, but... I wish I could! I'm writing a general purpose bot, so I can't assume that the new continue model will always be available. There are plenty of wikis still out there running on versions less than 1.21. – RobinHood70 talk 01:56, 19 May 2014 (UTC)
In that case i would recommend implementing the bot that supports the latest version, and doing a local simulation of that functionality. --Yurik (talk) 02:07, 19 May 2014 (UTC)
Already done. As suggested in the docs, it adds a continue= to each query and then waits till one of the requests returns a continue or query-continue block to figure out what it should be using from that point forward. If the site returns an old-style continue, it'll stop adding the continue= on any future requests. I may change the logic slightly to only add continues to queries that are actually continuable, but I'm undecided on that, since what's not-continuable today may become continuable tomorrow. – RobinHood70 talk 20:37, 21 May 2014 (UTC)

Removal of optional continue method[edit]

I've removed the second continue method (retain all props and emit continues from all of them) because it has a fatal flaw in the logic: if some modules never emit a continue, their data will be repeated with each request. This can lead to some rather large result sets. – RobinHood70 talk 06:41, 8 October 2014 (UTC)