-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
None
-
None
-
1
-
False
-
-
False
-
subs-swatch-lightning
-
-
During the implementation of component tests for SWATCH-4296, a pagination bug was identified in the Page.hasNext() method. When checking for available pages, the method incorrectly compares the next offset against the current page content size instead of the total result count. This causes the "next" pagination link to be null even when additional pages exist.
Current implementation: The method currently returns: pageable.getNextOffset() < content.size()
When InMemoryPager creates a Page object with a paginated subset (e.g., 10 items from 100 total), the logic compares nextOffset (10) < content.size() (10), which returns false.
Suggested fix: The logic should be updated to compare against the total result count: pageable.getNextOffset() < pageable.size
Production Impact
This bug has not affected clients in production because:
- Capacity endpoints do not use pagination parameters.
Acceptance Criteria
- Fix implemented in Page.hasNext() to check total size instead of page content size.
- @Disabled annotations removed from TC001 and TC002 in CapacityReportPaginationComponentTest.
- All three pagination component tests passing (TC001, TC002, TC003).
- Existing subscription and capacity endpoint functionality verified with no regressions.