Last modified: 2009-08-28 16:38:42 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 T22426, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 20426 - API: Fall back to max. limits instead of doing nothing at all if given limit is too big
API: Fall back to max. limits instead of doing nothing at all if given limit ...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Roan Kattouw
http://als.wikipedia.org/w/api.php?ac...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-27 22:35 UTC by Melancholie
Modified: 2009-08-28 16:38 UTC (History)
4 users (show)

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


Attachments

Description Melancholie 2009-08-27 22:35:20 UTC
Max. limits can be and are changed on the server-side, like recently for list=search; bots can log off e.g. (5000=>500); and rate limiting etc. is planned, thus let the API output fall back to the maximally allowed limit instead of doing nothing at all if the given limit is too big!

Example (bots > *10):
* http://als.wikipedia.org/w/api.php?action=query&list=search&srwhat=text&srsearch=kategorie&srlimit=500
formerly worked. Imagine a ("simple") script using this URL, it has to be changed to "50" now, or it will fatally fail. Of course it could look for
<error code="srlimit" info="srlimit may not be over 50 (set to 500) for users" xml:space="preserve">
and adapt its URL, but if it isn't too hard to do, just fall back to the max. limit on the server side automatically, if possible. Maybe create a parameter &limitfallback=1 (e.g.) to let the server do so, some scripts may rely on a specific count if *from is given.

*Otherwise* mention somewhere in the API documentation that allowed limits can (and will) change (e.g. during server attacks/problems, or like for list=search) and mention that a helping error code will appear on top then. So that people know that quick-and-dirty scripts will just fail in those cases ;-)
Comment 1 Roan Kattouw 2009-08-28 16:38:42 UTC
Done in r55652

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


Navigation
Links