Page MenuHomePhabricator

Client hints support for Chrome 90-97
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

On versions of Chrome between 90 and 97 (inclusive), the request to /checkuser/v0/useragent-clienthints/revision/ returns:

{"errorKey":"rest-missing-body-field","messageTranslation:{"en":"Mandatory field \"brands\" missing from request body"} ... }

(or alternatively ...\"fullVersionList\" missing...)

These versions of Chrome do support client hints, but are missing fields we mark as required. We could perhaps make those fields optional.

Versions 90-92 are missing the brands field.

Versions 93-97 are missing the fullVersionList field.

This also affects Edge and Opera (as they both are based on Chrome).

Steps to reproduce problem
  1. On a wiki with CheckUser installed and $wgCheckUserClientHintsEnabled = true (which is the default)
    1. Installing on docker
    2. Create one on https://patchdemo.wmflabs.org/ (You could try this exist one https://patchdemo.wmflabs.org/wikis/c7fc0fc3e1/wiki/Main_Page if it is still up)
  2. On any Chrome/Edge version 90-97 (or a version of Opera based on those versions of Chrome)
  3. Open devtools
  4. Make an edit (via Source Editor, Visual Editor or Discussion Tools)
  5. In devtools network tab, you should see a request to <server>/w/rest.php/checkuser/v0/useragent-clienthints/revision/<revid>

Expected behavior: Request returns 200
Observed behavior: Request returns 400

Environment

Browser: Tested on various versions of Chrome, Edge and Opera (on an emulated version of Windows 11).
Wiki(s): CheckUser 2.5 (93ada3d) 14:18, 25 July 2023.

Event Timeline

Change 941940 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] clienthints: Remove requirements for JS API

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

Change 941940 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] clienthints: Allow Client Hints API to accept partial data

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

@Dreamy_Jazz Issue has been resolved as seen in the screenshots below. The task will be moved to Done. Thanks for your work!

Test link used: https://patchdemo.wmflabs.org/wikis/59c6bb750d/wiki/Main_Page
Patch used: I91295a65ffd26931fb07278116ad6fea7d2ae5de

Browser/VerBefore FixAfter Fix
Chrome 90
T342729_CheckUser_ClientHintT_Chrome1.png (867×2 px, 377 KB)
T342729_CheckUser_ClientHintT_Chrome3.png (760×2 px, 353 KB)
Chrome 97
T342729_CheckUser_ClientHintT_Chrome2.png (837×2 px, 423 KB)
T342729_CheckUser_ClientHintT_Chrome4.png (885×2 px, 424 KB)
Edge 90
T342729_CheckUser_ClientHintT_Edge1.png (761×1 px, 421 KB)
T342729_CheckUser_ClientHintT_Edge3.png (782×2 px, 387 KB)
Edge 97
T342729_CheckUser_ClientHintT_Edge2.png (819×2 px, 481 KB)
T342729_CheckUser_ClientHintT_Edge4.png (804×2 px, 494 KB)