Page MenuHomePhabricator

Cross-wiki notifications don't appear to be working
Closed, ResolvedPublic

Description

Compare my enwp notifications:

Screenshot 2021-11-22 at 22-16-36 Wikipedia, the free encyclopedia.png (464×1 px, 71 KB)

vs Wikidata:

Screenshot 2021-11-22 at 22-16-56 Wikidata.png (558×1 px, 78 KB)

Even on Special:Notifications other wikis don't show up:

Screenshot 2021-11-22 at 22-18-05 Notifications - Wikipedia.png (1×3 px, 346 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I would have marked this as UBN, but it doesn't seem like anyone else has noticed or is complaining about this so I'm not sure if it's just me.

Legoktm triaged this task as Unbreak Now! priority.Tue, Nov 23, 6:24 PM

10:20:22 <Lucas_WMDE> I noticed but couldn’t be bothered to complain about it yet
10:20:31 <Lucas_WMDE> but I don’t think it’s just you

Yeah, I also noticed this yesterday but didn't complain yet.

There's nothing in Echo.log that indicates errors in making the cross-wiki API requests.

legoktm@mwmaint1002:~$ mwscript shell.php --wiki=enwiki
Psy Shell v0.10.8 (PHP 7.2.34-18+0~20210223.60+debian10~1.gbpb21322+wmf3 — cli) by Justin Hileman
>>> $u = User::newFromName('Legoktm');
=> User {#3292
     +mId: null,
     +mName: "Legoktm",
     +mActorId: null,
     +mRealName: null,
     +mEmail: null,
     +mTouched: null,
     +mEmailAuthenticated: null,
     +mFrom: "name",
     +mBlockedby: -1,
     +mHideName: null,
     +mBlock: null,
   }
>>> $unreadWikis = EchoUnreadWikis::newFromUser($u);
=> EchoUnreadWikis {#3294}
>>> $unreadWikis->getUnreadCounts();
=> [
     "metawiki" => [
       "alert" => [
         "count" => "0",
         "ts" => "00000000000000",
       ],
       "message" => [
         "count" => "1",
         "ts" => "20211110163611",
       ],
     ],
     "wikidatawiki" => [
       "alert" => [
         "count" => "1",
         "ts" => "20211122155917",
       ],
       "message" => [
         "count" => "0",
         "ts" => "00000000000000",
       ],
     ],
   ]

So it knows the wikis are unread, it's just choosing not to query them.

Uhhh, seems likely:

>>> $fn=new EchoForeignNotifications($u);
=> EchoForeignNotifications {#5775}
>>> $fn->isEnabledByUser();
=> false

Change 740871 had a related patch set uploaded (by Legoktm; author: Legoktm):

[mediawiki/extensions/Echo@master] Revert \"Add echo-cross-wiki-notifications to DefaultUserOptions\"

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

Change 740872 had a related patch set uploaded (by Legoktm; author: Legoktm):

[mediawiki/extensions/Echo@wmf/1.38.0-wmf.9] Revert \"Add echo-cross-wiki-notifications to DefaultUserOptions\"

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

The default of true seems to be set in wmf config, not extension config.

Maybe the order of loading config is now a problem, when the hook is running after the settings is set and overrides it.

https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/8b9e94cd0955d66344d706f4450e66f04683c86a/wmf-config/CommonSettings.php#3228

Change 740871 merged by jenkins-bot:

[mediawiki/extensions/Echo@master] Revert \"Add echo-cross-wiki-notifications to DefaultUserOptions\"

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

Change 740872 merged by jenkins-bot:

[mediawiki/extensions/Echo@wmf/1.38.0-wmf.9] Revert \"Add echo-cross-wiki-notifications to DefaultUserOptions\"

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

Mentioned in SAL (#wikimedia-operations) [2021-11-23T20:04:21Z] <legoktm@deploy1002> Synchronized php-1.38.0-wmf.9/extensions/Echo/: re-enable cross-wiki notifications by default (T296270) (duration: 00m 57s)

The default of true seems to be set in wmf config, not extension config.

Maybe the order of loading config is now a problem, when the hook is running after the settings is set and overrides it.

https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/8b9e94cd0955d66344d706f4450e66f04683c86a/wmf-config/CommonSettings.php#3228

I think so, the hook is overwriting the config...which would mean it's impossible to set defaults for any of the other settings?

The default of true seems to be set in wmf config, not extension config.

Maybe the order of loading config is now a problem, when the hook is running after the settings is set and overrides it.

https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/8b9e94cd0955d66344d706f4450e66f04683c86a/wmf-config/CommonSettings.php#3228

I think so, the hook is overwriting the config...which would mean it's impossible to set defaults for any of the other settings?

Also in Pre-UserOptionsLookup code [1] the hook overrides the defaults from LocalSettings.php.
It seems that options from the hook could not get values from the config. But the global is for that purpose.

It is not possible to change the order, because echo also looks for default of core settings, which should reflect changes in LocalSettings.php as well ... (but that is part of my patch set and could be removed as well).

The options with a fix name could be moved to extension.json, but the variable named options are not ready for overrides (but that is not new to echo extension).
Fixing all hooks to check if the option is already set is also much work and could be broken in future again.

[1] https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/refs/heads/REL1_34/includes/user/User.php#1703
[2] https://www.mediawiki.org/wiki/Manual:$wgDefaultUserOptions

Change 740940 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] Move core's $wgDefaultUserOptions into class DefaultOptionsLookup

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

Legoktm claimed this task.

Let's continue the discussion on T296347: Echo's default user options overrides prevent overrides in LocalSettings.php since the UBN cross-wiki notifs issue is fixed.