Page MenuHomePhabricator

Page collection name not reliably available from parser cache
Closed, ResolvedPublic

Assigned To
Authored By
SBisson
Feb 28 2025, 3:00 PM
Referenced Files
F58967189: 2025-04-02_10-54-50.png
Apr 2 2025, 5:57 PM
F58967187: 2025-04-02_10-54-42.png
Apr 2 2025, 5:57 PM
F58967185: 2025-04-02_10-55-23.png
Apr 2 2025, 5:57 PM
F58967183: 2025-04-02_10-54-06.png
Apr 2 2025, 5:57 PM
F58967165: 2025-04-02_10-49-13.png
Apr 2 2025, 5:57 PM
F58967163: 2025-04-02_10-48-38.png
Apr 2 2025, 5:57 PM
F58967161: 2025-04-02_10-48-45.png
Apr 2 2025, 5:57 PM
F58967159: 2025-04-02_10-47-59.png
Apr 2 2025, 5:57 PM

Description

The pagecollectionmetadata API implementation was modified for performance reasons to only fetch metadata from parser cache instead of parsing the page every time. It appears that in some cases the metadata is not available in the cache. As a result, the recommendation API uses the page title as the collection name even if a different name may be provided in the name attribute of the <page-collection> HTML marker.

The specified name being ignored is the first problem.

The second, and more serious, problem is that different servers may know the same collection by different names, which means they may perceive a collection as unknown and therefore not returning recommendations for it.

Possible solutions include

  • Reparsing the page in the API if the parser cache entry is not available
  • Having both collection id and name in the model so that even if the display name differs, the ID, which could be the page title, is consistent

Derived Requirement

Ensure that page collections using the <page-collection> markup correctly display their custom name in the unified dashboard. If a custom name is not specified, the collection should default to the page title.

  • Page collections with a name attribute should display the specified name in the unified dashboard.
  • Page collections without a name attribute should display the page title.
  • Collections in the User: and Event: namespaces should be excluded from verification.

Test Result - Beta|Prod

Status: ✅ PASS / ❓Need More Info / ❌ FAIL
Environment: beta/xyzwiki
OS: macOS Sequoia 15.4
Browser: Chrome 134
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify That Changes to the name Attribute Reflect in the Unified Dashboard

  1. Edit a page collection in the main namespace by modifying the name attribute inside the <page-collection> markup.
  2. Refresh the unified dashboard and locate the collection.
  3. ✅❓❌⬜ AC1: The updated name should be reflected in the unified dashboard.

Test Case 2: Verify That Page Collections in User and Event Namespaces Are Not Considered

  1. Navigate to a page collection in the User: or Event: namespace that includes the <page-collection> markup.
  2. Open the unified dashboard and locate the collection.
  3. ✅❓❌⬜ AC2: The collection should not appear in the unified dashboard.

QA Results - Test Wiki

ACStatusDetails
1T387570#10705386
2T387570#10705386

Event Timeline

SBisson triaged this task as Medium priority.
SBisson moved this task from Backlog to In-progress on the LPL Hypothesis board.

Change #1124175 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/WikimediaCampaignEvents@master] PageCollectionsMetadata API: Use ParserOutputAccess

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

Change #1124175 merged by jenkins-bot:

[mediawiki/extensions/WikimediaCampaignEvents@master] PageCollectionsMetadata API: Use ParserOutputAccess

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

@GMikesell-WMF the consequence of that bug is that some collections had a custom name specified on the page using the page collection markup: <page-collection name="CustomNameHrere"></page-collection> but that name was not being retrieve correctly and the collection was displayed in the unified dashboard as the page title.

One way to test that it is fixed is by going through the page collections in the category (only those in the main namespace so excluding User: and Event:) and verifying that they show up in the unified dashboard according to their name attribute or the page title for those without a custom name attribute.

@SBisson Confirmed that page collections using the <page-collection> markup correctly display their custom name in the unified dashboard. Along with collections in the User: and Event: namespaces should be excluded from verification a seen in the screenshots. I will move this to sign-off. Thanks for all your work!

Test Result -Test Wiki

Status: ✅ PASS
Environment: Test Wiki
OS: macOS Sequoia 15.4
Browser: Chrome 134
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify That Changes to the name Attribute Reflect in the Unified Dashboard

  1. Edit a page collection in the main namespace by modifying the name attribute inside the <page-collection> markup.
  2. Refresh the unified dashboard and locate the collection.
  3. AC1: The updated name should be reflected in the unified dashboard.
Page CollectionDesktop- SuggestionsDesktop- Adjust SuggestionsMobile
2025-04-01_14-20-16.png (791×780 px, 208 KB)
2025-04-01_14-26-17.png (835×1 px, 185 KB)
2025-04-01_14-43-52.png (806×901 px, 207 KB)
2025-04-01_14-43-02.png (825×819 px, 118 KB)
2025-04-01_14-40-57.png (772×746 px, 170 KB)
2025-04-01_14-41-28.png (838×920 px, 162 KB)
2025-04-01_14-41-21.png (817×816 px, 191 KB)
2025-04-01_14-41-38.png (825×786 px, 122 KB)
2025-04-01_15-06-13.png (738×718 px, 108 KB)
2025-04-01_15-06-56.png (832×967 px, 163 KB)
2025-04-01_15-06-47.png (836×986 px, 221 KB)
2025-04-01_15-07-35.png (824×746 px, 122 KB)
2025-04-01_15-19-09.png (959×741 px, 187 KB)
2025-04-01_15-19-46.png (826×978 px, 159 KB)
2025-04-01_15-19-30.png (836×928 px, 202 KB)
2025-04-01_15-20-02.png (829×931 px, 131 KB)
2025-04-01_15-45-03.png (856×720 px, 193 KB)
2025-04-01_15-45-24.png (828×880 px, 168 KB)
2025-04-01_15-45-03.png (856×720 px, 193 KB)
2025-04-01_15-45-42.png (817×765 px, 106 KB)
2025-04-01_15-54-58.png (738×710 px, 133 KB)
2025-04-01_15-55-14.png (821×812 px, 143 KB)
2025-04-01_15-55-05.png (845×834 px, 220 KB)
2025-04-01_15-55-29.png (823×817 px, 100 KB)
2025-04-01_15-56-58.png (867×735 px, 175 KB)
2025-04-01_15-57-17.png (822×751 px, 136 KB)
2025-04-01_15-57-09.png (821×707 px, 162 KB)
2025-04-01_15-57-26.png (830×837 px, 127 KB)
2025-04-01_15-58-42.png (840×732 px, 185 KB)
2025-04-01_15-58-59.png (788×851 px, 146 KB)
2025-04-01_15-58-51.png (835×823 px, 194 KB)
2025-04-01_15-59-13.png (810×743 px, 111 KB)
2025-04-01_16-00-32.png (756×687 px, 143 KB)
2025-04-01_16-00-47.png (837×790 px, 129 KB)
2025-04-01_16-00-41.png (842×813 px, 202 KB)
2025-04-01_16-01-02.png (827×820 px, 133 KB)
2025-04-01_16-02-01.png (858×734 px, 166 KB)
2025-04-01_16-02-17.png (833×799 px, 151 KB)
2025-04-01_16-02-09.png (835×779 px, 182 KB)
2025-04-01_16-02-50.png (824×735 px, 120 KB)
2025-04-01_16-04-17.png (905×748 px, 147 KB)
2025-04-01_16-04-42.png (821×770 px, 138 KB)
2025-04-01_16-04-34.png (840×793 px, 195 KB)
2025-04-01_16-04-42.png (821×770 px, 138 KB)
2025-04-02_10-47-59.png (895×751 px, 166 KB)
2025-04-02_10-48-45.png (834×877 px, 158 KB)
2025-04-02_10-48-38.png (825×1 px, 221 KB)
2025-04-02_10-49-13.png (835×755 px, 133 KB)

Test Case 2: Verify That Page Collections in User and Event Namespaces Are Not Considered

  1. Navigate to a page collection in the User: or Event: namespace that includes the <page-collection> markup.
  2. Open the unified dashboard and locate the collection.
  3. ✅ AC2: The collection should not appear in the unified dashboard.
EventUserList 1List 2
2025-04-02_10-54-06.png (848×728 px, 120 KB)
2025-04-02_10-55-23.png (927×739 px, 150 KB)
2025-04-02_10-54-42.png (1×871 px, 243 KB)
2025-04-02_10-54-50.png (1×820 px, 226 KB)