Page MenuHomePhabricator

New messages notification cannot be dismissed by unregistered users
Closed, ResolvedPublicBUG REPORT

Description

Multiple logged-out users are reporting that the new messages notification (aka the orange bar of doom) does not disappear even after checking their own talk pages.

Some reports here: enwiki, itwiki.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Titore updated the task description. (Show Details)

Are you sure that this worked previously? There are bug reports like this going back to 2013 (T59840), and as far as I know, due to the way caching for logged-out users work on Wikimedia wikis, the only reliable way of getting rid of the bar is making an edit.

The IP from itwiki just confirmed that it used to clear after clicking to "new messages", which is just a link to your own talk page, by the way. I just tested it on MediaWiki 1.39 (not Wikimedia though) and I can confirm it too.

IP users at enwiki also confirmed that it used to work for them. I tried locally now, and I can reproduce the issue. Curiously, API action=clearhasmsg works.

It looks like it's caused by the changes in 948208 watchlist: Prepare for IP Masking. The mechanism for marking your talk page as visited shares some code with the mechanism for marking the pages on your watchlist as visited, and after these changes, logged-out users no longer have the permission to mark pages on their watchlist as visited (previously they did, notwithstanding that they can't have a watchlist). Therefore we also don't try to mark their talk page as visited, even though that should be allowed. I think this line is not reached: WatchlistManager.php#221 because of the permission check above: WatchlistManager.php#204.

I'm not sure how this should be fixed. Should we introduce a new permission? Or should we just allow doing it with no permissions?

Change 954080 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/core@master] WatchlistManager: Do not require watchlist rights for clearing talk page notification

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

Urbanecm_WMF triaged this task as Medium priority.

Thanks for the investigation @matmarex and for summoning me here! In the long term, I think calls to TalkPageNotificationManager shouldn't be a part of WatchlistManager in the first place. For now, let's ignore the permission check and leave this refactoring for later, as that's easy to cause other/new regressions. Patch uploaded!

Change 954080 merged by jenkins-bot:

[mediawiki/core@master] WatchlistManager: Do not require watchlist rights for clearing talk page notification

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

Change 953660 had a related patch set uploaded (by Bartosz Dziewoński; author: Urbanecm):

[mediawiki/core@wmf/1.41.0-wmf.24] WatchlistManager: Do not require watchlist rights for clearing talk page notification

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

Change 953660 merged by jenkins-bot:

[mediawiki/core@wmf/1.41.0-wmf.24] WatchlistManager: Do not require watchlist rights for clearing talk page notification

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

Mentioned in SAL (#wikimedia-operations) [2023-08-31T20:36:12Z] <jhuneidi@deploy1002> Started scap: Backport for [[gerrit:953660|WatchlistManager: Do not require watchlist rights for clearing talk page notification (T345031)]]

Mentioned in SAL (#wikimedia-operations) [2023-08-31T20:37:38Z] <jhuneidi@deploy1002> jhuneidi and matmarex: Backport for [[gerrit:953660|WatchlistManager: Do not require watchlist rights for clearing talk page notification (T345031)]] synced to the testservers mwdebug1002.eqiad.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2002.codfw.wmnet, mwdebug2001.codfw.wmnet, and mw-debug kubernetes deployment (accessible via k8s-experimental XWD option)

Mentioned in SAL (#wikimedia-operations) [2023-08-31T20:43:14Z] <jhuneidi@deploy1002> Finished scap: Backport for [[gerrit:953660|WatchlistManager: Do not require watchlist rights for clearing talk page notification (T345031)]] (duration: 07m 01s)