Page MenuHomePhabricator

Limit watchlist labels to 100 per user
Closed, ResolvedPublicBUG REPORT

Description

Users should not be able to create more than 100 labels.

This is to avoid database size concerns, and other unnecessary complexity in implementation.


Derived Requirement

Limit the number of watchlist labels a user can create to 100. The system must prevent users from creating additional labels once this limit is reached and display an appropriate error or warning message.

Test Steps

Test Case 1: Verify user cannot create more than 2 watchlist labels
prereq- add to Local: $wgWatchlistLabelsMaxPerUser = 2;

  1. Log in to the wiki.
  2. Navigate to *Special:WatchlistLabels/edit*.
  3. Create watchlist labels until the count reaches 2.
  4. Attempt to create a 101st label.
  5. ✅❓❌⬜ AC1: Confirm the system prevents the creation of the 3rd label and displays an appropriate error or warning message.

Test Case 2: Verify existing labels can still be edited after reaching the limit
prereq- add to Local: $wgWatchlistLabelsMaxPerUser = 2;

  1. Log in as a user who already has 2 labels.
  2. Navigate to *Special:WatchlistLabels*.
  3. Edit any existing label and save changes.
  4. ✅❓❌⬜ AC2: Confirm that users can edit existing labels even after reaching the 2-label limit.

Test Case 3: Verify users can delete labels after reaching the limit
prereq- add to Local: $wgWatchlistLabelsMaxPerUser = 2;

  1. Log in as a user with 2 labels.
  2. Navigate to *Special:WatchlistLabels*.
  3. Delete one existing label.
  4. Attempt to create a new label.
  5. ✅❓❌⬜ AC3: Confirm that after deleting a label, the user can successfully create a new label without hitting the limit error.

QA Results - Local

ACStatusDetails
1T410383#11453034
2T410383#11453034
3T410383#11453034

Event Timeline

Change #1210613 had a related patch set uploaded (by Samtar; author: Samtar):

[mediawiki/core@master] WatchlistLabels: Limit to 100

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

Change #1214542 had a related patch set uploaded (by Samtar; author: Samtar):

[mediawiki/core@master] WatchlistLabels: Limit to 100

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

Change #1210613 abandoned by Samtar:

[mediawiki/core@master] WatchlistLabels: Limit to 100

Reason:

see I4b8628e6f10b52ec5fbed71be142e4d554436bb6

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

Change #1214542 merged by jenkins-bot:

[mediawiki/core@master] WatchlistLabels: Limit to 100

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

@TheresNoTime Are the last bits here the disabling of the 'new label' button, and perhaps a warning when going directly to Special:WatchlistLabels?

Samwilson changed the task status from Open to In Progress.Dec 5 2025, 5:20 AM

@TheresNoTime Confirmed that there is a limit on watchlist labels, display an error message, as seen in the videos below. I will mark this as Resolved. Thanks for all your work!

Test Result - Local

Status: ✅ PASS
Environment: Local: MediaWiki 1.46.0-alpha (b4939f1) 15:44, 11 December 2025
OS: macOS Tahoe 26.1
Browser: Chrome 142
Device: MBA
Emulated Device: NA

Test Artifact(s):
prereq- add to Local: $wgWatchlistLabelsMaxPerUser = 2;

Test Steps

Test Case 1: Verify user cannot create more than 2 watchlist labels
prereq- add to Local: $wgWatchlistLabelsMaxPerUser = 2;

  1. Log in to the wiki.
  2. Navigate to *Special:WatchlistLabels/edit*.
  3. Create watchlist labels until the count reaches 2.
  4. Attempt to create a 3rd label.
  5. ✅ AC1: Confirm the system prevents the creation of the 3rd label and displays an appropriate error or warning message.

Test Case 2: Verify existing labels can still be edited after reaching the limit
prereq- add to Local: $wgWatchlistLabelsMaxPerUser = 2;

  1. Log in as a user who already has 2 labels.
  2. Navigate to *Special:WatchlistLabels*.
  3. Edit any existing label and save changes.
  4. ✅ AC2: Confirm that users can edit existing labels even after reaching the 2-label limit.

Test Case 3: Verify users can delete labels after reaching the limit
prereq- add to Local: $wgWatchlistLabelsMaxPerUser = 2;

  1. Log in as a user with 2 labels.
  2. Navigate to *Special:WatchlistLabels*.
  3. Delete one existing label.
  4. Attempt to create a new label.
  5. ✅ AC3: Confirm that after deleting a label, the user can successfully create a new label without hitting the limit error.

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