Page MenuHomePhabricator

When a page has a label assigned, edits to its corresponding talk page are not labelled
Closed, ResolvedPublic

Description

Steps to reproduce

  1. Watch page Foo
  2. Assign a label to Foo
  3. Make an edit to Foo
  4. Make an edit to Talk:Foo
  5. Filter for the label in your Watchlist - the edit to Foo is displayed, but the edit to Talk:Foo is not.

In this example I added Test label to the Ma Tau Wai Road building collapse page.

Screenshot 2026-02-02 at 10.18.28.png (1,810×224 px, 108 KB)

Screenshot 2026-02-02 at 10.18.39.png (1,818×544 px, 104 KB)


Derived Requirement

Ensure that when a label is assigned to a watched page, edits to both the page and its corresponding talk page are associated with that label and are displayed when filtering the watchlist by that label.

Test Steps

Test Case 1: Ensure edits to labeled page appear when filtering by label

  1. Watch a page (e.g., Foo).
  2. Assign a label to the watched page.
  3. Make an edit to Foo.
  4. Navigate to Special:Watchlist.
  5. Apply a filter for the assigned label.
  6. ✅❓❌⬜ AC1: The edit to Foo appears in the filtered watchlist results.

Test Case 2: Ensure edits to corresponding talk page also appear when filtering by label

  1. With the same labeled page (Foo), make an edit to Talk:Foo.
  2. Navigate to Special:Watchlist.
  3. Apply a filter for the same assigned label.
  4. Observe the filtered results.
  5. ✅❓❌⬜ AC2: The edit to Talk:Foo appears in the filtered watchlist results when filtering by the page’s label.

QA Results -Beta

ACStatusDetails
1T416147#11609500
2T416147#11609500

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

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

[mediawiki/core@master] Special:EditWatchlist: Add labels to both subject and talk pages

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

Change #1238295 merged by jenkins-bot:

[mediawiki/core@master] Special:EditWatchlist: Add labels to both subject and talk pages

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

Should you also check the case when the content page does not exist?

Should you also check the case when the content page does not exist?

I'm not sure I understand. Do you mean when you label a watched non-existing page, and then that page is later created? That works, as far as I can see, with the current set-up. A page and its talk page are given the label, regardless of if either exist yet.

(Moving back to in-development because there's still a maintenance script to write here to backfill the missing talk pages.)

@Samwilson Confirmed when a page has a label assigned, edits to its corresponding talk page are labelled, as seen in the screenshot/video below. I will mark this as Resolved. Thanks for all your work!

Test Result - Beta

Status: ✅ PASS
Environment: Beta
OS: macOS Tahoe 26.2
Browser: Chrome 143
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://en.wikipedia.beta.wmcloud.org/w/index.php?title=Special:Watchlist&days=30&hideWikibase=1&hidecategorization=1&hidepreviousrevisions=1&limit=500&urlversion=2&wllabel=52

Test Steps

Test Case 1: Ensure edits to labeled page appear when filtering by label

  1. Watch a page (e.g., Foo).
  2. Assign a label to the watched page.
  3. Make an edit to Foo.
  4. Navigate to Special:Watchlist.
  5. Apply a filter for the assigned label.
  6. AC1: The edit to Foo appears in the filtered watchlist results.

2026-02-11_09-29-32.png (1,283×868 px, 202 KB)

Test Case 2: Ensure edits to corresponding talk page also appear when filtering by label

  1. With the same labeled page (Foo), make an edit to Talk:Foo.
  2. Navigate to Special:Watchlist.
  3. Apply a filter for the same assigned label.
  4. Observe the filtered results.
  5. AC2: The edit to Talk:Foo appears in the filtered watchlist results when filtering by the page’s label.

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

Should you also check the case when the content page does not exist?

I'm not sure I understand. Do you mean when you label a watched non-existing page, and then that page is later created? That works, as far as I can see, with the current set-up. A page and its talk page are given the label, regardless of if either exist yet.

(Moving back to in-development because there's still a maintenance script to write here to backfill the missing talk pages.)

No, not that. I'm curious if this scenario should be checked by its own:

  1. Some page does not exist.
  2. Its talk page exists.
  3. The page gets a label.
  4. Check if the talk page edits include this label.

Don't know how the mechanism is build, so not sure if it should a case different from the rest.

Yep, that flow works correctly. It doesn't matter if either page exists or not at the time of adding the labels, it just has to be on the watchlist.

Re-opening this because I still need to finish the maintenance script.

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

[mediawiki/core@master] Add cleanupWatchlistLabelMember maintenance script

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

The plan here is basically to run the following insert statement:

INSERT INTO watchlist_label_member (wlm_label, wlm_item)
SELECT DISTINCT wlm_subject.wlm_label, wl_talk.wl_id
FROM watchlist wl_subject
JOIN watchlist wl_talk 
    ON wl_subject.wl_user = wl_talk.wl_user 
    AND wl_subject.wl_namespace + 1 = wl_talk.wl_namespace
    AND wl_subject.wl_title = wl_talk.wl_title
    AND wl_subject.wl_id != wl_talk.wl_id
JOIN watchlist_label_member wlm_subject
    ON wlm_subject.wlm_item = wl_subject.wl_id
LEFT JOIN watchlist_label_member wlm_talk
    ON wlm_talk.wlm_item = wl_talk.wl_id
    AND wlm_talk.wlm_label = wlm_subject.wlm_label
WHERE wlm_talk.wlm_item IS NULL

I've started work on a maintenance script to do this, which will also be run as part of update.php.

Change #1239562 merged by jenkins-bot:

[mediawiki/core@master] Add cleanupWatchlistLabelMember maintenance script

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

As the maintenance script is handled in a separate task, I think everything here is done now.