Skip to content

->reverse_dependencies returns only 50 results even if there are more #122

@wchristian

Description

@wchristian

MetaCPAN::Client->reverse_dependencies returns only 50 results even if there are more, and doesn't automatically fetch more results if ->next on the resultset runs out of those 50

it seems MetaCPAN::Client wants to pass the request size via the POST parameters, but they're ignored unless they're in the query url

this monkeypatch seems to make it do the right thing:

my $old_fetch = \&MetaCPAN::Client::fetch;
my $new_fetch = sub { $old_fetch->( shift, shift . "?size=5000", @_ ) };
{ no warnings 'redefine'; *MetaCPAN::Client::fetch = $new_fetch; }

from IRC:

<haarg> it seems to be trying to pass an ES query, but the api isn't expecting that
<alh> reverse_dependencies() uses items instead of a scroller so it'll never fetch the next page if I'm reading it right
<alh> Or is the 'size => 5000' supposed to just "grab them all in one go" 
<haarg> the extra arguments it passes are entirely ignored
<haarg> because that end point wants form type params (GET or POST) not a json body

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

To do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions