radicle-client-services icon indicating copy to clipboard operation
radicle-client-services copied to clipboard

http-api: Amount of projects fetched from /v1/projects wrong

Open sebastinez opened this issue 2 years ago • 2 comments

It seems that by filtering out projects that return an Err we do not provide the amount of projects asked from the endpoint.

This probable happens when obtaining their Info, after doing the pagination with skip and take.

My idea is that we should get and validate the projects info during the iterator, so we always can return the asked amount.

To reproduce the issue, try for example https://maple.radicle.garden:8777/v1/projects?per-page=10&page=2 and I obtained 6 instead of 10 projects.

sebastinez avatar Oct 07 '22 12:10 sebastinez

Hmm, are there really 4 projects that fail on that second page? Seems weird..

Alternatively, we should change the iterator to not count failed projects, so we get 10 valid projects.

cloudhead avatar Oct 10 '22 08:10 cloudhead

Alternatively, we should change the iterator to not count failed projects, so we get 10 valid projects.

Yes I think that should be the way to do it.

sebastinez avatar Oct 10 '22 11:10 sebastinez

This is superseded by https://github.com/radicle-dev/heartwood/issues/179

sebastinez avatar Dec 23 '22 21:12 sebastinez