Page MenuHomePhabricator

Mentor dashboard M1: Searching and filtering does not work reliably outside of first page
Closed, ResolvedPublic

Description

Original description by @Etonkovidova

(1) It seems that the search for a user can be performed only from the first page (the page number 1).

  • go to Special:MentorDashboard
  • from a default view, search for a mentee that is on the list but not displayed on the first page. I searched for ET14 (listed on the page 5 of the default view) - the user is found.
Screen Shot 2021-08-26 at 6.06.02 PM.png (1×1 px, 390 KB)
Screen Shot 2021-08-26 at 6.06.16 PM.png (1×2 px, 236 KB)
  • go to the second page and perform the same search - the user won't be found
Screen Shot 2021-08-26 at 6.14.02 PM.png (1×1 px, 358 KB)
Screen Shot 2021-08-26 at 6.15.54 PM.png (850×1 px, 114 KB)

In, fact the user ET14 (listed on the page 5) won't be found from any other page except the page 1 (including the page 5 where the user name is displayed).

Problem

When reproducing this issue, I realized that it also affects filtering, not only searching. That is because the pagination code still remembers it is supposed to show results from 2nd/3rd/10th page, while after applying the filter/search, there are often not enough such pages.

In another words, filtering works perfectly, but it shows results from a page that does not in the filtered set.

Solution

The solution is to reset state of pagination before a search/filtering is performed. That is necessary, because the filtered data will contain different number of users, and thus will need a different number of pages.

Will upload a patch shortly.

Event Timeline

Change 715310 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] Mentee overview: Reset pagination state before performing a search

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

Tgr subscribed.

Moving to In Progress as a follow-up is needed. The user-facing bug is fixed though.

Change 715310 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Mentee overview: Reset pagination state before performing a search

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

Change 715718 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] Mentee overview: Do not reset page size after searches

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

Change 715718 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Mentee overview: Do not reset page size after searches

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

Checked in betalabs - works perfectly. Test in Production.

Boldly resolving then.