Fix commits API incorrectly reporting hasNextPage: true when no more commits exist
Summary
The commits API incorrectly reports hasNextPage: true in the pagination response even when there are no more commits to fetch.
Context: !222424 (comment 3065323587)
Background
This was identified during the review of !222424 (merged) (Add cursor pagination to commit list). The frontend pagination relies on the hasNextPage value to determine whether to show/enable the "Next" button, but the backend is returning incorrect pagination metadata.
Expected Behavior
hasNextPage should return false when the current page contains the last commits in the list.
Actual Behavior
hasNextPage returns true even when there are no more commits, which can lead to users clicking "Next" and receiving an empty result set.
Acceptance Criteria
-
hasNextPagecorrectly returnsfalsewhen on the last page of commits - Cursor-based pagination accurately reflects the remaining data
Related
- !222424 (merged) - Add cursor pagination to commit list (parent MR where this was identified)
Edited by Jacques Erasmus