Page MenuHomePhabricator

When requesting content, drvlimit/adrlimit/arvlimit/rvlimit is 500, not 5000
Closed, ResolvedPublicBUG REPORT

Description

Note: with apihighlimit it's 500, otherwise 50.

Steps to replicate the issue (include links if applicable):

drvlimit
    Limit how many revisions will be returned. 
    Type: integer or max
    The value must be between 1 and 5,000.

Compare:

What happens?:

"warnings": {
     "deletedrevisions": {
         "*": "The value \"5000\" for parameter \"drvlimit\" must be between 1 and 500."
     }

What should have happened instead?:
The numbers should have matched.

Event Timeline

It depends on how you're making the request.

https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=help&modules=query%2Bdeletedrevisions
The value must be between 1 and 5,000.

You're seeing this because you're probably doing this request while logged in (which uses your apihighlimits right)

Without content: https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=query&prop=deletedrevisions&drvslots=*&drvlimit=5000&titles=User:AJ/move1&drvprop=ids|timestamp|flags|comment|user
With content: https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=query&prop=deletedrevisions&drvslots=*&drvlimit=5000&titles=User:AJ/move1&drvprop=ids|timestamp|flags|comment|user|content

And then you're doing this while logged out (or with less privileged account)?

...
commons.wikimedia.beta.wmflabs.org/w/api.php?action=query&prop=deletedrevisions&drvslots=*&drvlimit=5000&titles=User:AJ/move1&drvprop=ids|timestamp|flags|comment|user|content&assertuser=AJ

"*": "The value \"5000\" for parameter \"drvlimit\" must be between 1 and 500."

Only admins can request deletedrevisions anyway.. (I would have noticed the "code": "permissiondenied", the only difference is whether I request content or not, requesting content reduces the limit)

The code to reduce the limit when content is parsed is in ApiQueryRevisionsBase, so this affects the following modules:

  • list=alldeletedrevisions with adrlimit
  • list=allrevisions with arvlimit
  • prop=deletedrevisions with drvlimit
  • prop=revisions with rvlimit

Also the deprecated list=deletedrevs with drlimit

Umherirrender renamed this task from When requesting content, drvlimit is 500, not 5000 to When requesting content, drvlimit/adrlimit/arvlimit/rvlimit is 500, not 5000.Nov 14 2023, 10:11 PM

The code to reduce the limit when content is parsed is in ApiQueryRevisionsBase, so this affects the following modules:

  • list=alldeletedrevisions with adrlimit
  • list=allrevisions with arvlimit
  • prop=deletedrevisions with drvlimit
  • prop=revisions with rvlimit

Also the deprecated list=deletedrevs with drlimit

Thanks for the clarification and research. You're talking about another sense of "parse" I'm guessing as the wikitext isn't actually parsed like action=parse does.

The code to reduce the limit when content is parsed is in ApiQueryRevisionsBase, so this affects the following modules:

  • list=alldeletedrevisions with adrlimit
  • list=allrevisions with arvlimit
  • prop=deletedrevisions with drvlimit
  • prop=revisions with rvlimit

Also the deprecated list=deletedrevs with drlimit

Thanks for the clarification and research. You're talking about another sense of "parse" I'm guessing as the wikitext isn't actually parsed like action=parse does.

Yes, when fetching content the limit is set to 50/500, the normal limit is 500/5000. When parsing content via drvparse parameter the limit is set to 1/1.

The first number is without apihighlimit, the second with that right. There is no depending on the modul name, if you see different numbers that must depend on the rights (logged out vs. sysop/bot account)

The code to reduce the limit when content is parsed is in ApiQueryRevisionsBase, so this affects the following modules:

  • list=alldeletedrevisions with adrlimit
  • list=allrevisions with arvlimit
  • prop=deletedrevisions with drvlimit
  • prop=revisions with rvlimit

Also the deprecated list=deletedrevs with drlimit

Thanks for the clarification and research. You're talking about another sense of "parse" I'm guessing as the wikitext isn't actually parsed like action=parse does.

Yes, when fetching content the limit is set to 50/500, the normal limit is 500/5000. When parsing content via drvparse parameter the limit is set to 1/1.

The first number is without apihighlimit, the second with that right. There is no depending on the modul name, if you see different numbers that must depend on the rights (logged out vs. sysop/bot account)

I see, I tried rvlimit on enwiki and I have no apihighlimit there.

Change 974682 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] api: On revision related modules add extra info to limit parameter

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

Change 974682 merged by jenkins-bot:

[mediawiki/core@master] api: On revision related modules add extra info to limit parameter

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