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

fix incorrect pin count when filtering #126

Merged
merged 1 commit into from
Mar 19, 2022
Merged

Conversation

gmelodie
Copy link
Contributor

When querying for /pinning/pins?status=SOMESTATUS the API was actually listing the count of the original query (before applying the status filter). So for instance if you had 15 pins total but only 2 of them were queued and you requested /pinning/pins?status=queued you would get a count of 15 instead of 2.

Fixes #124

@gmelodie gmelodie requested a review from whyrusleeping March 16, 2022 20:05
@gmelodie gmelodie self-assigned this Mar 16, 2022
Copy link

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's ensure a real array is always present. iiuc this should avoid triggering panic (ipfs/go-pinning-service-http-client#14):

pinning.go Show resolved Hide resolved
@gmelodie gmelodie force-pushed the fix-invalid-pin-count branch from c27af2b to 2c2b01e Compare March 18, 2022 16:36
@gmelodie gmelodie merged commit 1d6e6e3 into master Mar 19, 2022
@gmelodie gmelodie deleted the fix-invalid-pin-count branch March 19, 2022 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid pin listing response: {"count":15,"results":null}
2 participants