Skip to content

Commits paging works incorrectly #658

@D-CURT

Description

@D-CURT

Hello.

I faced an issue with pagination while iterating by commits.

Gitlab4j API version: 4.15.7

I'm calling
api.getCommitsApi().getCommits(projectName, branchName, since, until, null, ITEMS_SIZE);

And a pager (Pager) hasNext() enternally returns true.

So, I'm stucking on:
while (pager.hasNext()) {
pager.next();
}

After pager initialization:
currentPage: 0, kaminariNextPage: 2, itemsPerPage: 100, currentItems: 111 (in my case), totalPages: -1, totalItems: -1.

The first page properties:
currentPage: 1, kaminariNextPage: 2, itemsPerPage: 100, currentItems: 111, totalPages: -1, totalItems: -1.

The second page properties:
currentPage: 2, kaminariNextPage: 3, itemsPerPage: 100, currentItems: 0, totalPages: -1, totalItems: -1.

The third page properties:
currentPage: 3, kaminariNextPage: 4, itemsPerPage: 100, currentItems: 0, totalPages: -1, totalItems: -1.
...

commist pager call

commits page props

commits pager 1st

commits pager 2nd

Thanks,
D-CURT.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions