Page MenuHomePhabricator

[wmf.17- regression] Homepage - no Task type selection is allowed
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue
(the issuse was reproducible on wmf.7cswiki and eswiki)

  • Go to Special:Special:NewcomerTasksInfo page, e.g. cs:Special:NewcomerTasksInfo and find tasks+topic combination that will fetch zero suggested articles. For cswiki it's Chemistry+update
  • On Special:Homepage select Chemistry as a topic.
  • For the task type, select Update - the number of found suggestions should be zero.
  • De-select Update - the warning "Select at least one type of edit" appears. Click on 'X' to close the filter selection overlay.
  • Add another topic.

What happens?:

  • The task types filter selection is empty.
  • The task counter incorrectly displays zero for the number of available tasks even if many topics have been selected.
  • Reloading the page will display suggestions, but the task types filter selection will still display empty state.
One topic with zero suggestions is selectedAll added topics still produce zero resultsAfter reloading - persistent empty state for the task type filters
Screen Shot 2022-10-27 at 3.44.49 PM.png (1×1 px, 122 KB)
Screen Shot 2022-10-27 at 3.45.15 PM.png (1×1 px, 121 KB)
Screen Shot 2022-10-27 at 3.45.36 PM.png (1×1 px, 182 KB)

What should have happened instead?:

  • The task filter selection should never be blank

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Etonkovidova renamed this task from [wmf.7 mobile - regression] Homepage - Task type selection could be zero to [wmf.7- regression] Homepage - Task type selection could be zero .Oct 27 2022, 12:58 AM
Etonkovidova updated the task description. (Show Details)
Etonkovidova renamed this task from [wmf.7- regression] Homepage - Task type selection could be zero to [wmf.7- regression] Homepage -no Task type selection is allowed.Oct 27 2022, 1:01 AM
Etonkovidova renamed this task from [wmf.7- regression] Homepage -no Task type selection is allowed to [wmf.7- regression] Homepage - no Task type selection is allowed.Oct 27 2022, 1:04 AM

Thank you for the detailed steps to reproduce. I think we should fix this, and it hopefully would not be too difficult to do.

Re-tested in wmf.14 (and on testwiki wmf.17) - there is a much simpler scenario that lead to the non-selected-task-types state:

  • select some combination of filters (task types and topics) that fetch some results
  • deselect Task types filters - the warning appear and the counter shows that 0 results were found
    • click on x button to close the popup
  • the displayed result won't changed (empty state for task type filters cannot be saved; the result should be displayed as nothing was changed by deselecting the filters). Task types filters are still selected and they are displayed as selected - CORRECT behavior.
  • go to the topic selection filters and deselect all topics - 0 results will be displayed with task types filters become deselected. After that it's possible to select a topic(s) without selecting task type filters.
Etonkovidova renamed this task from [wmf.7- regression] Homepage - no Task type selection is allowed to [wmf.17- regression] Homepage - no Task type selection is allowed.Jan 3 2023, 9:47 PM
KMorgan-WMF changed the task status from Open to In Progress.Jan 10 2023, 6:27 AM
KMorgan-WMF claimed this task.

I think the source of the problem was introduced on the refactor in T303985, it was a long patch (gerrit 785235) to review and I can't find comments in regards the controversial code: SuggestedEditsModule.prototype.updateFilterSelection. We probably missed something then.

I think the trouble comes from updating together task types and topic filters in one single function updateFilterSelection. The method is called on every search action from both dialog and retrieves the state from the ooui widget instead of the filters store. For cases where the user exits the dialog with the close button, that means the data remains correct in the store state since there's a backup mechanism, but incorrect in the widget state. That's why the last request made from the topic dialog that @Etonkovidova describes, results in zero tasks. A request is made to the tasks API without informing any task type on the request.

To fix it I think we can update the store state on each widget so the fetch function can read a correct state from the store. If we do so there's no need for an updateFilterSelection method before performing a new search action.

Change 888049 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/extensions/GrowthExperiments@master] Suggested edits: avoid requesting tasks with invalid filters

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

Change 888049 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Suggested edits: avoid requesting tasks with invalid filters

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

Etonkovidova changed the task status from In Progress to Open.EditedFeb 27 2023, 11:57 PM

Checked in enwiki betalabs and wmf.24 - works as expected.