Page MenuHomePhabricator

Count of wishes on wish index page does not account for filters
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
MusikAnimal
Sep 10 2025, 9:31 PM
Referenced Files
F66029069: image.png
Sep 18 2025, 12:17 AM
F66026471: 2025-09-16_13-47-16.mp4.gif
Sep 17 2025, 3:34 PM
F66026469: 2025-09-16_13-38-16.mp4.gif
Sep 17 2025, 3:34 PM
F66026467: 2025-09-16_13-34-46.mp4.gif
Sep 17 2025, 3:34 PM
F66026461: 2025-09-16_13-32-19.png
Sep 17 2025, 3:34 PM
F66026459: 2025-09-16_13-31-55.png
Sep 17 2025, 3:34 PM
F66026457: 2025-09-16_13-30-56.png
Sep 17 2025, 3:34 PM

Description

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

What happens?:

The count is not the same as the number of wishes returned.

What should have happened instead?:

The query for counting wishes should take into account any filters that are applied.


Derived Requirement

The ApiQueryWishes module must ensure that the crwcount option reflects the number of wishes after filters are applied. When filters such as crwtags, crwfocusareas, or other valid parameters are added, the communityrequests-wishes-metadatacount value must match the number of wishes returned in the API response.

Test Result - Beta|Prod

Status: ✅ PASS / ❓Need More Info / ❌ FAIL
Environment: beta/MetaWiki
OS: macOS Sequoia 15.6.1
Browser: Chrome 140
Device: MBA

Test Artifact(s):

Test Steps

Test Case 1: Count With Tag Filter

  1. Open Special:ApiSandbox.
  2. Run a query with list=communityrequests-wishes and add a valid crwtags filter (e.g., categories).
  3. ✅❓❌⬜ AC1: Confirm that the count value matches the number of wishes returned.

Test Case 2: Count With Different Focus Area Filter

  1. Open Special:ApiSandbox.
  2. Run a query with list=communityrequests-wishes, and add a valid crwtags filter (e.g., search).
  3. ✅❓❌⬜ AC2: Confirm that the count reflects only wishes belonging to the selected focus area.

Test Case 3: Count With Multiple Filters

  1. Run a query with list=communityrequests-wishes,, and apply multiple filters (e.g., crwtags=search & mobileweb).
  2. ✅❓❌⬜ AC3: Confirm that the count matches the number of wishes returned after applying all filters.

Test Case 4: Invalid Filter Handling

  1. Run a query with list=communityrequests-wishes, and apply an invalid filter value (e.g., crwtags=invalidtag).
  2. ✅❓❌⬜ AC4: Confirm that the count returns 0 and the list of wishes is empty.

QA Results - Meta Beta

ACStatusDetails
1T404264#11190282
2T404264#11190282
3T404264#11190282
4Pass per T404264#11192283

Event Timeline

Samwilson changed the task status from Open to In Progress.Sep 10 2025, 11:45 PM
Samwilson claimed this task.

Change #1187407 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/CommunityRequests@master] Guard againt an invalid focus area title in ApiQueryWishes

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

Change #1187407 merged by jenkins-bot:

[mediawiki/extensions/CommunityRequests@master] Guard againt an invalid focus area title in ApiQueryWishes

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

Change #1187996 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/CommunityRequests@master] [WIP] Add filters to getCount()

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

Change #1187996 merged by jenkins-bot:

[mediawiki/extensions/CommunityRequests@master] Add filters to getCount()

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

@Samwilson Please review AC4 when you have a free moment, thanks!

Test Result - Meta Beta

Status: ✅ PASS
Environment: Meta Beta
OS: macOS Sequoia 15.6.1
Browser: Chrome 140
Device: MBA

Test Artifact(s):

Test Steps

Test Case 1: Count With Tag Filter

  1. Open Special:ApiSandbox.
  2. Run a query with list=communityrequests-wishes and add a valid crwtags filter (e.g., categories).
  3. AC1: Confirm that the count value matches the number of wishes returned.
APIWishlist_1Wishlist_2
2025-09-16_13-30-56.png (1×855 px, 155 KB)
2025-09-16_13-31-55.png (956×864 px, 167 KB)
2025-09-16_13-32-19.png (1×1 px, 220 KB)

Test Case 2: Count With Different Focus Area Filter

  1. Open Special:ApiSandbox.
  2. Run a query with list=communityrequests-wishes, and add a valid crwtags filter (e.g., search).
  3. AC2: Confirm that the count reflects only wishes belonging to the selected focus area.

2025-09-16_13-34-46.mp4.gif (1×1 px, 2 MB)

Test Case 3: Count With Multiple Filters

  1. Run a query with list=communityrequests-wishes,, and apply multiple filters (e.g., crwtags=search & mobileweb).
  2. AC3: Confirm that the count matches the number of wishes returned after applying all filters.

2025-09-16_13-38-16.mp4.gif (1×1 px, 3 MB)

Test Case 4: Invalid Filter Handling

  1. Run a query with list=communityrequests-wishes, and apply an invalid filter value (e.g., crwtags=invalidtag).
  2. AC4: Confirm that the count returns 0 and the list of wishes is empty.

2025-09-16_13-47-16.mp4.gif (1×1 px, 3 MB)

Test Case 4: Invalid Filter Handling
Run a query with list=communityrequests-wishes, and apply an invalid filter value (e.g., crwtags=invalidtag).
❌ AC4: Confirm that the count returns 0 and the list of wishes is empty.

That is because of the ApiSandbox not actually submitting invalidtag. It's red and that's meant to indicate that the value has not been accepted by the form. In the results page you can see what's been submitted:

image.png (619×1 px, 67 KB)

To really test it you can go direct to the actual API: https://meta.wikimedia.beta.wmcloud.org/w/api.php?action=query&crwtags=invalidtag&list=communityrequests-wishes&crwcount=1

There you can see there's a warning (because the invalid tag name has been submitted this time): Unrecognized value for parameter \"crwtags\": invalidtag

I wasn't really sure what should happen in that case. Perhaps it should return no wishes, because after all there aren't any that match that. However, what if you submit crwtags=invalidtag|botsgadgets? Then we do expect it to return those that are tagged botsgadgets. So I think it's fair to say that it finds all tags after leaving out invalid ones, and in the case of only one invalid one it's finding all wishes.

Oh I see now. Thanks for the explanation, makes sense. Ok on that note, I will mark this as Resolved now. Thanks for all your work!

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.