Page MenuHomePhabricator

Newcomer tasks: Don't cache a task set for listTaskCounts, and don't invoke TaskSet listener
Closed, ResolvedPublic


We use the maintenance/listTaskCounts.php script in production to generate data for a Grafana dashboard, as well as to populate a cache for Special:NewcomerTasksInfo.

The mechanism for listTaskCounts uses the same infrastructure we use to generate task sets for users. This has two unwanted side effects:

  • a TaskSet is cached for the user, which is not a huge problem in itself, but is not really correct either, since in this context we always want uncached data
  • The TaskSetListener.php is invoked after a TaskSet is fetched, which in turns triggers calls to the image suggestion API to filter out image suggestion tasks that no longer have metadata. We definitely don't need this to happen, as it involves spamming the image suggestion service.

Acceptance Criteria

  1. listTaskCounts.php should not result in cached TaskSet
  2. listTaskCounts.php should not spam the image suggestion service
Completion checklist


  • The patches have been code reviewed and merged
  • The task passes its acceptance criteria


  • There are existing and passing unit/integration tests
  • Tests for every involved patch should pass
  • Coverage for every involved project should have improved or stayed the same

Design & QA

  • If the task is UX/Design related: it must be reviewed and approved by the UX/Design team
  • Must be reviewed and approved by Quality Assurance.


  • Related and updated documentation done where necessary

Event Timeline

Out of 35,211 instances of GrowthExperiments\NewcomerTasks\AddImage\ServiceImageRecommendationProvider::get: Unable to decode JSON response for page {title}: {response} in the last 7 days, 2,121 of them come from listTaskCounts.php.

SuggestionInfo calls the TaskSuggester with 'useCache' => false; in theory that should prevent caching the TaskSet. As for the listener, the simplest way to prevent it from doing anything is to change the limit parameter for the task search to 0.

Moving this into the sprint since there is a trivial solution.

Change 834551 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/GrowthExperiments@master] Do not fetch any results in SuggestionsInfo

Change 834551 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Do not fetch any results in SuggestionsInfo