Page MenuHomePhabricator

[wmf.4] NewPagesFeed - Article for Creation filter does not work with All option
Closed, ResolvedPublic

Description

On Special:NewPagesFeed select the Articles for Creation filter and select All option in the State group:

Screen Shot 2022-03-23 at 3.27.42 PM.png (924×2 px, 223 KB)

The page will never finish to load the results.
https://test.wikipedia.org/w/api.php?action=pagetriagestats&format=json&show_predicted_class_b=1&show_predicted_issues_spam=1&date_range_from=2022-03-01T00%3A00%3A00.000Z&date_range_to=2022-03-17T23%3A59%3A59.000Z&namespace=118&afc_state=all&showunreviewed=1&showreviewed=1&afcDir=oldestfirst

{"error":{"code":"badinteger","info":"Invalid value \"all\" for integer parameter \"afc_state\".","*":"

The Console displays the following errors:

Uncaught TypeError: Cannot read properties of undefined (reading 'pages')
Uncaught TypeError: Cannot read properties of undefined (reading 'stats')

Event Timeline

Assuming this task is about the PageTriage code project, hence adding that project tag so other people who don't know or don't care about team tags can also find this task when searching via projects. Please set appropriate project tags when possible. Thanks!

kostajh added subscribers: Ammarpad, TheresNoTime.

Not sure if this is related to recent changes made to PageTriage code, adding @TheresNoTime and @Ammarpad as recent committers to the project in case they'd like to look.

I did not find what might have caused this recently.

But I noticed that the client has always passed possibly invalid value for this prop. Since the commit that introduced AfC state filters (change 440018), 'afc_state' prop has been declared as integer param for API. The value is passed directly from the client code as is: apiParams.afc_state and that contains non-integer string ('all') from the underscore template.

API error "badinteger", for such values has been there for a long time too. I cannot pinpoint to where exactly it began, but the regex check it uses will fail such string values at least since introduction of ParamValidator to core in early 2020.

Etonkovidova renamed this task from [wmf.4] NewPagesFeed - Article for Creation filter does not work with to [wmf.4] NewPagesFeed - Article for Creation filter does not work with All option.May 10 2022, 10:58 PM

Change 800699 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/extensions/PageTriage@master] article.js - don't pass 'all' for afc_state

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

Came across this while looking into something else, fairly trivial fix - just don't pass 'all' to the api, but continue to store it

Change 800699 merged by jenkins-bot:

[mediawiki/extensions/PageTriage@master] article.js - don't pass 'all' for afc_state

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

Novem_Linguae assigned this task to DannyS712.
Novem_Linguae added a subscriber: Novem_Linguae.

I'm not able to reproduce either. I agree that Danny's patch probably fixed this. Marking as resolved. Feel free to reopen if the issue is re-encountered.