Page MenuHomePhabricator

[Regression wmf.5] On enhanced watchlists, boldness styling shows regardless of diffs being seen, and a gadget is broken
Closed, ResolvedPublic

Description

Hello. Our hewiki has Group 2 1 deployment, an hour ago. From that moment Special:Watchlist is completely destroyed.

  • I have revisions grouping. Every group with one element marked as read before I opened it, even those from this morning.
  • Users complain on my talk page too. One said he does not have bold at all.
  • Another said he has bold, but opening the revision does not remove it.
  • I had a non bold revision for editing my talk page at the same time with orange notice.
  • The safemode does not help.
  • Our wiki has a WLM (WatchList Manager) gadget, and it shows bullshit, meaning html code of the watchlist special page is destroyed.

Thank you.

Event Timeline

Jdforrester-WMF updated the task description. (Show Details)

hewiki's not been in group 2 for many months, it's a group 1 deployment wiki, BTW.

Jdforrester-WMF renamed this task from [Regression wmf.5] Reports of some issue with enhanced watchlist functionality to [Regression wmf.5] On enhanced watchlists, boldness styling shows regardless of diffs being seen, and a gadget is broken.Jun 14 2017, 8:42 PM

Sorry, a typo. I always think about 1-2-3 in place of 0-1-2.

Something is definitely wrong. The mw-changeslist-line-watched CSS class is applied in non-enhanced mode but not in enhanced mode on hewiki. In fact, all the mw-changeslist-* classes have disappeared and been replaced with data-revid. It does work correctly on enwiki, so this is in fact a wmf5 regression.

I strongly suspect rMW016452cd09f4: ChangesList: Expose basic properties of lines as data attributes is at fault here, I'll try to reproduce locally and see if that was indeed where it broke.

Steps to reproduce:

  • watchlist a page
  • edit it from a different account/anon
  • view RC with the original account

The edit should be bold but is not.

More specifically, the mw-changeslist-watched class is missing from the table element. In fact all classes seem to be missing.

Could be a bug in https://gerrit.wikimedia.org/r/#/c/336963/ 016452cd09f4b32100f4fa3740168c5fc161d496.

Classes should be added to $attribs only after isReservedDataAttribute has been called, otherwise it removes them.

We were right, it was that commit. In every code path, it does this:

$attribs = wfArrayFilterByKey( $attribs, [ Sanitizer::class, 'isReservedDataAttribute' ] );

This is broken because the effect is the reverse of what's intended:

> $attrs = [ 'class' => ['foo', 'bar', 'baz'], 'data-ooui' => 'foo', 'data-revid' => 123 ];

> var_dump(wfArrayFilterByKey($attrs, [ Sanitizer::class, 'isReservedDataAttribute' ] ) );
array(1) {
  'data-ooui' =>
  string(3) "foo"
}

The reason enhanced and non-enhanced behave differently was because enhanced adds the classes to $attribs before the filtering step (so the classes get filtered out), and non-enhanced adds them after (so they don't get filtered out). This inconsistency shouldn't exist, but even non-enhanced was broken in that all data attributes were presumably being dropped.

Change 359047 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/core@master] Fix changes list data attribute sanitizing

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

@Tgr hit some more hurdles while trying to fix this. Nothing insurmountable, but for the time being we decided to revert the change in wmf.5 but keep it unreverted in master (to make fixing it a bit easier). It also appears that the data attributes added by this change don't actually get added for the most part, so we're not really losing much functionality there.

I'm putting the revert in the next SWAT window (33 minutes from now).

Change 359067 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/core@master] Revert "ChangesList: Expose basic properties of lines as data attributes"

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

Change 359070 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/core@wmf/1.30.0-wmf.5] Revert "ChangesList: Expose basic properties of lines as data attributes"

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

It also appears that the data attributes added by this change don't actually get added for the most part, so we're not really losing much functionality there.

Those seem to work fine for me. Nothing uses them yet, though.

Change 359070 merged by jenkins-bot:
[mediawiki/core@wmf/1.30.0-wmf.5] Revert "ChangesList: Expose basic properties of lines as data attributes"

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

Mentioned in SAL (#wikimedia-operations) [2017-06-14T23:33:21Z] <catrope@tin> Synchronized php-1.30.0-wmf.5/includes/: Unbreak watchlist highlighting T167922 (duration: 01m 30s)

Catrope claimed this task.

This is reverted in wmf.5 now, and watchlist highlighting is working again for me.

mmodell added a subscriber: mmodell.

Although this was reverted in wmf.5, what about wmf.6?

Although this was reverted in wmf.5, what about wmf.6?

https://gerrit.wikimedia.org/r/#/c/359067/ was written for master if it wasn't fixed in time. We could re-pick that to wmf.6?

Well since that hasn't merged yet I guess I'll cherry-pick it. Thanks

Change 360414 had a related patch set uploaded (by 20after4; owner: Gergő Tisza):
[mediawiki/core@wmf/1.30.0-wmf.6] Fix enhanced RC data attribute sanitizing

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

Change 360414 merged by jenkins-bot:
[mediawiki/core@wmf/1.30.0-wmf.6] Fix enhanced RC data attribute sanitizing

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

Change 359047 merged by jenkins-bot:
[mediawiki/core@master] Fix enhanced RC data attribute sanitizing

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

Change 359067 abandoned by Catrope:
Revert "ChangesList: Expose basic properties of lines as data attributes"

Reason:
Looks like the bug was fixed and this can be abandoned. Please yell at me if I got it wrong.

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