What is the problem?
When a user has the "Show a confirmation prompt when clicking on a rollback link" preference enabled, the Client Hints REST API is not called on a successful rollback.
Steps to reproduce problem
- Install the CheckUser extension
- Open the Chrome browser
- While logged in or logged out, create a page
- Log into a different account than the one used in step 3 that also has the administrator group (sysop).
- Enable the preference "Show a confirmation prompt when clicking on a rollback link" shown in the "Appearance" tab of Special:Preferences.
- Make an edit to the page created in step 3
- Open the history page for this page
- Click on the "rollback 1 edit" link for the edit made in step 6 and then click "Rollback" when asked to confirm.
- Get the revision ID for the edit performed by clicking the rollback link (this edit should have the Rollback tag).
- Inspect the database table cu_useragent_clienthints_map using the following SQL after replacing <rev id> with the revision ID of the rollback gained in step 9:
SELECT * FROM cu_useragent_clienthints_map WHERE uachm_reference_id = <rev id> AND uachm_reference_type = 0;
Expected behavior: Rows should be returned by the query, as the API should have been called
Observed behavior: No rows are returned by the query
Environment
Wiki(s): MediaWiki 1.41.0-alpha (f626d90) 00:43, 3 September 2023. CheckUser 2.5 (560ca5ac) 01:05, 2 September 2023.
Extra info
Because when using this preference, the rollback requests are made via POST. As such, the CheckUser code does not set the HTTP headers because there is no point in setting the headers on post requests (as the action usually is performed once a post request is returned successfully). However, because the Client Hints API makes the request separately using the data from the JS API, the data can be collected via this method on POST requests.
QA Results - Local
AC | Status | Details |
---|---|---|
1 | ✅ | https://phabricator.wikimedia.org/T345518 |