Page MenuHomePhabricator

InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList': The token provided ('mw-ui-button mw-ui-quiet mw-ui-icon mw-ui-icon-element mw-ui-icon-bell') contains HTML space characters, which are not valid in tokens.
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

New error in 1.41.0-wmf.5
124 errors in last 1hr

Seems to be due to a misuse of classList.add which is being passed multiple classes.
https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/add

We should use apply arguments instead.

QA steps

  1. Login and visit https://en.wikipedia.beta.wmflabs.org/wiki/Dog
  2. Click the echo icon
  3. Verify that what is depicted in T335149#8796958 has been resolved

Event Timeline

Jdlrobson triaged this task as Medium priority.Apr 20 2023, 3:59 PM
Jdlrobson raised the priority of this task from Medium to High.Apr 20 2023, 4:47 PM
Jdlrobson added a project: Notifications.

I can replicate this when clicking the Echo notifications button. The icon styling breaks when clicked:

Screenshot 2023-04-20 at 9.47.07 AM.png (107×399 px, 12 KB)

Change 910579 had a related patch set uploaded (by Nray; author: Nray):

[mediawiki/skins/Vector@master] Fix InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList'

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

Change 910579 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Fix InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList'

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

Edtadros subscribed.

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

Login and visit https://en.wikipedia.beta.wmflabs.org/wiki/Dog
Click the echo icon
✅ AC1: Verify that what is depicted in T335149#8796958 has been resolved

Screenshot 2023-04-20 at 7.50.05 PM.png (119×514 px, 11 KB)

Change 911366 had a related patch set uploaded (by Nray; author: Nray):

[mediawiki/skins/Vector@wmf/1.41.0-wmf.5] Fix InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList'

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

Change 911366 merged by jenkins-bot:

[mediawiki/skins/Vector@wmf/1.41.0-wmf.5] Fix InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList'

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

Mentioned in SAL (#wikimedia-operations) [2023-04-24T20:41:19Z] <cjming@deploy2002> Started scap: Backport for [[gerrit:911366|Fix InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList' (T335149)]]

Mentioned in SAL (#wikimedia-operations) [2023-04-24T20:42:34Z] <cjming@deploy2002> cjming and nray: Backport for [[gerrit:911366|Fix InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList' (T335149)]] synced to the testservers: mwdebug2001.codfw.wmnet, mwdebug1002.eqiad.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2002.codfw.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-04-24T20:52:45Z] <cjming@deploy2002> Finished scap: Backport for [[gerrit:911366|Fix InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList' (T335149)]] (duration: 11m 25s)