Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wchristian opened this issue Feb 23, 2024 · 5 comments
Open
Assignees

Comments

@wchristian
Copy link
Contributor

wchristian commented Feb 23, 2024

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
wchristian added a commit to Perl-Critic/PPI that referenced this issue Feb 23, 2024
wchristian added a commit to Perl-Critic/PPI that referenced this issue Feb 23, 2024
@mickeyn
Copy link
Contributor

mickeyn commented Feb 28, 2024

Yeah I see the problem, the ES query is passed as an ignored param. the internal API query does the same without the size value.
I'll patch that.

@oalders
Copy link
Member

oalders commented Sep 3, 2024

@mickeyn do you know where we are on this?

@mickeyn
Copy link
Contributor

mickeyn commented Sep 4, 2024

@oalders sorry I put this one aside for too long. I'll try to handle it soon.

@oalders
Copy link
Member

oalders commented Sep 4, 2024

No worries, @mickeyn. I don't think it's urgent. 😄

@mickeyn
Copy link
Contributor

mickeyn commented Sep 20, 2024

@oalders This is an issue in metacpan-api - the API endpoint not reading body parameters sent. I'm still trying to work it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To do
Development

No branches or pull requests

3 participants