In order to properly support the collection view dialog in CX unified dashboard (T379273), we need to add support for pagination for single page collection recommendations.
More specifically, we want to support a new page URL parameter and when this parameter is present, the API will return the corresponding page for the page collection recommendations, without any shuffling.
Edit:
Fetching single page collection recommendations in "pages", also allows us to fetch fewer suggestions per request, without the risk of fetching duplicate recommendations per request. However, the final approach for this "pagination" was decided to use a continue feature. That means that the API generates and returns a continue_seed that when used always shuffles the page collection in the same way, and a continue_offset which indicates the index of the last processed page in the collection. Using these "continuation" parameters, the caller can obtain the page collection recommendations in "pages" of any size, but only in sequential requests.
E.g. first page request (page size=6):
https://api.wikimedia.org/service/lw/recommendation/api/v1/translation?source=en&target=el&collections=true&seed=Software&count=6
Now using the returned from API continue_offset and continue_seed parameters we can get the second page. The returned offset from the above request is 8, thus we'll use a continue_offset equal to 9:
https://api.wikimedia.org/service/lw/recommendation/api/v1/translation?source=en&target=el&collections=true&seed=Software&count=6&continue_seed=887932336&continue_offset=9
In similar way, we can fetch the following pages.
Derived Requirement
Ensure that the Recommendation API supports pagination for single page collection recommendations by using continuation parameters. When a client provides continue_seed and continue_offset, the API must return the next sequential page of recommendations from the same deterministically shuffled collection, without introducing duplicate or reshuffled results across requests.
Test Steps
Test Case 1: Ensure initial collection recommendation request returns continuation parameters
- Send a request to the Recommendation API for single page collection recommendations with collections=true and a defined count value.
- Inspect the API response payload.
- ✅❓❌⬜ AC1: The response includes both continue_seed and continue_offset parameters along with the first page of recommendations.
Test Case 2: Ensure subsequent paginated request returns the next sequential set of recommendations
- Using the continue_seed and continue_offset returned from the initial request, send a second API request including these continuation parameters.
- Inspect the list of returned recommendations.
- ✅❓❌⬜ AC2: The response returns the next sequential page of recommendations from the same collection, without duplicates and without reshuffling compared to the initial request.
QA Results - TestWiki
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T384485#11547237 |
| 2 | ✅ | T384485#11621349 |






