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

Pagination works unexpected #12

Open
EugenMayer opened this issue May 8, 2022 · 1 comment
Open

Pagination works unexpected #12

EugenMayer opened this issue May 8, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@EugenMayer
Copy link

EugenMayer commented May 8, 2022

Assuming one has 360 artifacts and uses ListArtifacts to fetch them with a maximum page size of 100, so

	params := artifact.ListArtifactsParams{
		Page:           page,
		PageSize:       100,
		ProjectName:  "myproject",
		RepositoryName: "myimage"
	}

We should assume to fetch 4 pages, while the last page only includes 60 artifacts. In fact, the last page includes 100 artifacts instead.

We start with page 0 end end up page 3, fetching 4x100, instead of 3x100+1x60

@EugenMayer
Copy link
Author

After fiddling around i happened to notice that a page should start at 1 for harbor (kind of unusual in the technical space), and that was the reason.

Far more interesting on top of that is, that page:0 also returns a result, not sure this is deterministic at all

@Vad1mo Vad1mo added the bug Something isn't working label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants