What is the problem?
When creating or editing watchlist labels, I am seeing in the logs:
[rdbms] Expectation (writes <= 0) by MediaWiki\SpecialPage\SpecialPageFactory::executePath not met (actual: 1) in trx #6e673b1c99:
role-primary: INSERT IGNORE INTO `watchlist_label` (wll_user,wll_name) VALUES '?'
#0 /var/www/html/w/includes/libs/Rdbms/TransactionProfiler.php(345): Wikimedia\Rdbms\TransactionProfiler->reportExpectationViolated()
#1 /var/www/html/w/includes/libs/Rdbms/Database/TransactionManager.php(572): Wikimedia\Rdbms\TransactionProfiler->recordQueryCompletion()
#2 /var/www/html/w/includes/libs/Rdbms/Database/Database.php(852): Wikimedia\Rdbms\TransactionManager->recordQueryCompletion()
#3 /var/www/html/w/includes/libs/Rdbms/Database/Database.php(705): Wikimedia\Rdbms\Database->attemptQuery()
#4 /var/www/html/w/includes/libs/Rdbms/Database/Database.php(632): Wikimedia\Rdbms\Database->executeQuery()
#5 /var/www/html/w/includes/libs/Rdbms/Database/Database.php(1506): Wikimedia\Rdbms\Database->query()
#6 /var/www/html/w/includes/libs/Rdbms/Database/DBConnRef.php(127): Wikimedia\Rdbms\Database->insert()
#7 /var/www/html/w/includes/libs/Rdbms/Database/DBConnRef.php(455): Wikimedia\Rdbms\DBConnRef->__call()
#8 /var/www/html/w/includes/libs/Rdbms/QueryBuilder/InsertQueryBuilder.php(340): Wikimedia\Rdbms\DBConnRef->insert()
#9 /var/www/html/w/includes/Watchlist/WatchlistLabelStore.php(45): Wikimedia\Rdbms\InsertQueryBuilder->execute()
#10 /var/www/html/w/includes/Specials/SpecialWatchlistLabels.php(139): MediaWiki\Watchlist\WatchlistLabelStore->save()
#11 /var/www/html/w/includes/HTMLForm/HTMLForm.php(812): MediaWiki\Specials\SpecialWatchlistLabels->onSubmit()
#12 /var/www/html/w/includes/HTMLForm/HTMLForm.php(693): MediaWiki\HTMLForm\HTMLForm->trySubmit()
#13 /var/www/html/w/includes/HTMLForm/HTMLForm.php(709): MediaWiki\HTMLForm\HTMLForm->tryAuthorizedSubmit()
#14 /var/www/html/w/includes/Specials/SpecialWatchlistLabels.php(103): MediaWiki\HTMLForm\HTMLForm->show()
#15 /var/www/html/w/includes/Specials/SpecialWatchlistLabels.php(58): MediaWiki\Specials\SpecialWatchlistLabels->showForm()
#16 /var/www/html/w/includes/SpecialPage/SpecialPage.php(711): MediaWiki\Specials\SpecialWatchlistLabels->execute()
#17 /var/www/html/w/includes/SpecialPage/SpecialPageFactory.php(1743): MediaWiki\SpecialPage\SpecialPage->run()
#18 /var/www/html/w/includes/Actions/ActionEntryPoint.php(499): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#19 /var/www/html/w/includes/Actions/ActionEntryPoint.php(143): MediaWiki\Actions\ActionEntryPoint->performRequest()
#20 /var/www/html/w/includes/MediaWikiEntryPoint.php(184): MediaWiki\Actions\ActionEntryPoint->execute()
#21 /var/www/html/w/index.php(44): MediaWiki\MediaWikiEntryPoint->run()
#22 {main}Steps to reproduce problem
- On any local test environment, add this to LocalSettings.php: $wgEnableWatchlistLabels = true;
- Login
- Create a new label by going to Special:WatchlistLabels/edit
- Look in your local logs (if you have a local docker setup you should see in the cache directory of your mediawiki install a file called mw-debug-web.log)
Environment
Wiki(s): local docker MediaWiki 1.46.0-alpha (66c0066) 07:36, 25 November 2025.
Derived Requirement
The system must not perform unintended database write operations when a user creates or edits watchlist labels on *Special:WatchlistLabels/edit*. Executing this page must meet the “writes ≤ 0” expectation in MediaWiki\SpecialPage\SpecialPageFactory::executePath and should not trigger any unexpected writes to watchlist_label or any other table.
Test Steps
Test Case 1: Ensure no unexpected DB writes occur when creating a new watchlist label
Preconditions:
- $wgEnableWatchlistLabels = true is set in LocalSettings (or Patchdemo environment configured similarly).
- Log in to the Local Wiki.
- Navigate to *Special:WatchlistLabels/edit*.
- Create a new watchlist label.
- Access the debug logs (e.g., mw-debug-web.log in local ).
- ✅❓❌⬜ AC1: Confirm no unexpected database write violations occur and the “writes ≤ 0” expectation is satisfied.
Test Case 2: Ensure no unexpected DB writes occur when editing an existing watchlist label
Preconditions:
- $wgEnableWatchlistLabels = true enabled.
- At least one label already exists.
- Log in to the wiki.
- Navigate to *Special:WatchlistLabels/edit*.
- Select an existing label and modify its name.
- Save the changes.
- Open and inspect the debug logs.
- ✅❓❌⬜ AC2: Confirm no unexpected database write violations occur and the “writes ≤ 0” expectation is satisfied.
QA Results - Local
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T411030#11450008 |
| 2 | ✅ | T411030#11450008 |

