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

[Bug]: API models endpoint drops first model on pagination #1111

Closed
BlafKing opened this issue Apr 1, 2024 · 1 comment · Fixed by #1113
Closed

[Bug]: API models endpoint drops first model on pagination #1111

BlafKing opened this issue Apr 1, 2024 · 1 comment · Fixed by #1113
Labels
bug-report Something might not be working

Comments

@BlafKing
Copy link
Contributor

BlafKing commented Apr 1, 2024

What happened?

When using the new cursor system to move between pages of models, the first model on subsequent pages is missing.

Steps to reproduce the problem

  1. Go to https://civitai.com/api/v1/models?limit=2
  2. Click the nextPage URL
  3. Notice the first model missing compared to a request with a higher limit https://civitai.com/api/v1/models?limit=4

What should have happened?

All models should show on subsequent pages.

What platforms do you use to access the site?

Windows

What browsers do you use to access the site?

Brave

Additional information, context and logs

I'd assume that this is a zero bias problem with the new cursor system, but that's only an assumption.

@sulley57
Copy link

sulley57 commented Apr 5, 2024

This issue is still present when applying the following query parameters and utilizing nextCursor: username, limit, sort, nsfw

Example:

Utilizing the nextCursor on the API query with First 50 to retrieve the Next 50, the 51st model from the First 100 API query is missing from the Next 50. Exhausting the nextCursor function until completion, there are the same amount of missing models as there were nextCursors provided.

Additional troubleshooting...

Things get quite strange when troubleshooting this with another user, nochekaiser881:

The 51st model and ongoing from the Next 50 do not follow the same ordered listing as the First 100 API query, despite using the sort parameter. Nothing about this API query is different from the first example apart from the username (and nextCursor of course).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Something might not be working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants