Page MenuHomePhabricator

Function page only displays up to ten test cases
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
The "Test cases" box shows 1/2 screens. The first screen shows five test cases. Clicking on the > arrow right, I can take a look at another five test cases. But there are, in fact, twelve test cases. The test cases https://wikifunctions.beta.wmflabs.org/wiki/Z10481 and https://wikifunctions.beta.wmflabs.org/wiki/Z10482 are inaccessible.

What should have happened instead?:
It should have three screens of test cases, so the last two test cases can also be accessed.

Bug details
The API wikilambdafn_search has pagination, which means that without the parameter "limit" it only returns the first 10 items:

Pagination in the tester/implementation tables is implemented without integrating the pagination features of the API, there are two possible options to fix this bug:

  • We skip the API pagination, we request all the available testers by adding the url prop &limit=500 to the API call, and we continue paginating in the front-end with all the testers stored in the Vuex store.
  • We integrate the API call into the pagination features of the front-end table, so every time we click on the page buttons, we call the API with the required limit=5&continue= url props to bring the requested page. This means that the whole list of testers is never available in the Vuex store, only the requested page.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

The issue here is how pagination is implemented: it is both using the pagination features of the backend (which returns the first page, which by default is 10 items), and then paging the result in the frontend (which is always max of two pages).
We have two ways to fix this, either we page with the API or we page with filtering over the store data. I've added details to the bug description.

I suggest that we increase the default from 10 to 500 - that should last us for a looong while.

Change 877117 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Add wikilambdafn_limit parameter to wikilambdafn_search calls

https://gerrit.wikimedia.org/r/877117

Change 877117 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Add wikilambdafn_limit parameter to wikilambdafn_search calls

https://gerrit.wikimedia.org/r/877117