Page MenuHomePhabricator

Prepare GlobalWatchlist for IP masking
Closed, ResolvedPublic

Description

Hi. As far as I can see, there are at least three things to do:

  1. Change the link from (pretty broken) User:~2025-... to Special:Contribs/~2025-... .
  2. (optional) Color the link background gray.
  3. Put the ~ characters on the right left side for RTL parts by enclosing with <bdi> for every account name.

Thank you.

image.png (117×1 px, 50 KB)


QA
There are the manual tests:

  1. Open meta:Special:GlobalWatchlist.
  2. Add in Settings at least one ltr wiki, for example enwiki, and at least one rtl wiki, for example hewiki.
  3. Make sure to have at least one page with at least one registered user edit and at least one temporal account edit, as non read yet edits.
  4. Check that clicking on temporal account link opens Special:Contribs/<this account>.
  5. Check that temporal account links have grey background, and according background in the Dark theme.
  6. Check that ~ character in temporal account names is at the left in all the cases.

Thank you.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Niharika triaged this task as Medium priority.Jul 11 2025, 9:41 AM
Niharika changed the subtype of this task from "Bug Report" to "Task".

@IKhitron Hello! Is this work still pending? Do you know who owns GlobalWatchlist?

@IKhitron Hello! Is this work still pending? Do you know who owns GlobalWatchlist?

Yes, it is. It's DannyS712. It's his Foundation grant, to support this extension. But he wasn't here for 17 months, @Niharika, and on wikis almost 11 months.

@IKhitron Hello! Is this work still pending? Do you know who owns GlobalWatchlist?

Officially I believe ext:GlobalWatchlist currently has no stewarding team.

Thank you for that information. I am going to remove our team tag from this task since we don't have the capacity to pick it up at the moment.

Thank you for that information. I am going to remove our team tag from this task since we don't have the capacity to pick it up at the moment.

A pity. Can you give me a link for the extension code, please? I wrote a part of it - the code that takes care of RTL. Maybe I could suggest some patches, even it's a very long shot, @Niharika. Thank you.

Hi, per https://www.mediawiki.org/wiki/New_Developers, "in a Phabricator task, use the project tags in the side bar to find the code repository for the task".

This comment was removed by IKhitron.
This comment was removed by IKhitron.
This comment was removed by IKhitron.
This comment was removed by IKhitron.
This comment was removed by IKhitron.
This comment was removed by IKhitron.

Thank you.

Well, here is the full patches suggestion:

  1. In the file https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/GlobalWatchlist/+/refs/heads/master/modules/specialglobalwatchlist/WatchlistUtils.js, line 278, add
		entry.anon = entry.anon || entry.temp;
  1. In the file https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/GlobalWatchlist/+/refs/heads/master/modules/specialglobalwatchlist/WatchlistUtils.js change line 138 to
userLink = '<a href="' + userLinkURL + '" target="_blank"' + (editsByUser[ userMessage ].anon ? ' dir=ltr style="background:gray;"' : '') + '>' + userMessage + '</a>';

That's all, @Niharika. Hope it helps to move it towards the resolving.

Thanks for taking a look at the code! You are very welcome to use a Developer Account to submit the proposed code changes as a Git branch directly into Gerrit which makes it easier to review and provide feedback. If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader. Thanks again.

Change #1211732 had a related patch set uploaded (by Gerrit Patch Uploader; author: IKhitron):

[mediawiki/extensions/GlobalWatchlist@master] Phabricator T398361: Prepare GlobalWatchlist for IP masking

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

Thanks for taking a look at the code! You are very welcome to use a Developer Account to submit the proposed code changes as a Git branch directly into Gerrit which makes it easier to review and provide feedback. If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader. Thanks again.

Thank you, @Aklapper. I did what you said. I also wanted to debug it, but Mediawiki blocks me from doing this from some reason, so I could only test as much as possible in browser Developer tools. Could you tell me please how can I edit my patch? There is a need in little copy edit, and when I click on save I get an error message. "Error 403 (Forbidden): edit not permitted".

I also improved the code of the patch, for example, it works in the Dark theme now.

Hi, I guess https://www.mediawiki.org/wiki/Gerrit/Web_tutorial#Modify_a_change but I doubt that you can edit a Gerrit patch uploaded by an account not yourself

Can I ask somebody to edit it? All I need is to remove one of the background:background: in line 138.
UPD: I made all the steps, with the account and ssh. Does not help, GUI edit does not work, and git edit either. But now I succeeded to add a comment about this.

Looks like I can edit it. Done :)

I also edited the commit message to follow the format in https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines

Change #1211732 had a related patch set uploaded (by Aklapper; author: IKhitron):

[mediawiki/extensions/GlobalWatchlist@master] Prepare GlobalWatchlist for IP masking

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

I have added IKhitron to the Trusted Contributors group on Gerrit (https://gerrit.wikimedia.org/r/admin/groups/2021f25e7515187a81d51f8fe14dd6f25617cce0) so they can now edit others' patches.

Thank you both very much. There was an error with less spaces near parentheses, and I succeeded to edit it.

@IKhitron as for the placement of ~, I wonder if using dir=ltr is the right solution. Specifically, I wonder if wrapping the element in <bdi> would be sufficient (and preferred).

@IKhitron as for the placement of ~, I wonder if using dir=ltr is the right solution. Specifically, I wonder if wrapping the element in <bdi> would be sufficient (and preferred).

Thank you for your help, @Huji. I've read some documentation about the bdi tag, and debugged some special pages. And I have a question. Wouldn't it be better to enclose any user name with bdi, not just temporary accounts? It is done in Special:Watchlist, and it prevents problems in names like User:John-, which is not forbidden in Mediawiki, as far as I could find the restrictions for special characters in usernames.

@IKhitron as for the placement of ~, I wonder if using dir=ltr is the right solution. Specifically, I wonder if wrapping the element in <bdi> would be sufficient (and preferred).

Thank you for your help, @Huji. I've read some documentation about the bdi tag, and debugged some special pages. And I have a question. Wouldn't it be better to enclose any user name with bdi, not just temporary accounts? It is done in Special:Watchlist, and it prevents problems in names like User:John-, which is not forbidden in Mediawiki, as far as I could find the restrictions for special characters in usernames.

It is. And in several places, it is already done. In a few places it is not done, and we should fix those.

Thanks, done. Waiting for the bots in Gerrit.

Well, there is a test failure, but the problem is in the test, not in my code, I think. Don't sure, I need to see the test. This is the output:

18:52:50 FAILED TESTS:
18:52:50   ext.globalwatchlist.specialglobalwatchlist/WatchlistUtils
18:52:50     ✖ watchlistUtils.normalizeEntries
18:52:50       Firefox 140.0 (Linux 0.0.0)
18:52:50     Edits without comments are normalized to parsedcomment=''
18:52:50     Expected: [
18:52:50       {
18:52:50         "anon": false,
18:52:50         "newPage": false,
18:52:50         "parsedcomment": "",
18:52:50         "tags": [],
18:52:50         "timestamp": "2020-08-31 12:00",
18:52:50         "type": "edit",
18:52:50         "user": ""
18:52:50       }
18:52:50     ]
18:52:50     Actual: [
18:52:50       {
18:52:50         "anon": undefined,
18:52:50         "newPage": false,
18:52:50         "parsedcomment": "",
18:52:50         "tags": [],
18:52:50         "timestamp": "2020-08-31 12:00",
18:52:50         "type": "edit",
18:52:50         "user": ""
18:52:50       }
18:52:50     ]
18:52:50     @http://localhost:9876/load.php?modules=%40wikimedia%2Fcodex%2Ccodex-styles%2Coojs%2Coojs-ui-core%2Coojs-ui-widgets%2Coojs-ui-windows%2Cpinia%2Csinonjs%2Cvue%2Cvue-test-utils%7Cext.globalwatchlist.specialglobalwatchlist%7Cjquery.client%2ChighlightText%2ClengthLimit%2CmakeCollapsible%2Ctablesorter%2CtextSelection%7Cjquery.makeCollapsible.styles%7Cjquery.tablesorter.styles%7Cmediawiki.DateFormatter%2CForeignApi%2CString%2CTitle%2CUri%2Capi%2Ccldr%2CconfirmCloseWindow%2Ccookie%2Cdeflate%2Cexperiments%2Cinspect%2CjqueryMsg%2Clanguage%2CmessagePoster%2Cqunit-testrunner%2Crouter%2Cstorage%2Ctemplate%2Ctoc%2Cuser%2Cutil%2CvisibleTimeout%2Cwidgets%7Cmediawiki.ForeignApi.core%7Cmediawiki.language.grammar.testdata%7Cmediawiki.language.jqueryMsg.testdata%7Cmediawiki.language.months%2Ctestdata%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%7Cmediawiki.pager.codex%7Cmediawiki.rcfilters.filters.ui%7Cmediawiki.special.block.codex%7Cmediawiki.template.mustache%7Cmediawiki.widgets.MediaSearch%2CTable%2CUserInputWidget%2Cstyles%7Coojs-ui-core.icons%2Cstyles%7Coojs-ui-widgets.icons%7Coojs-ui-windows.icons%7Coojs-ui.styles.icons-content%2Cicons-editing-advanced%2Cicons-editing-core%2Cicons-editing-styling%2Cicons-interactions%2Cicons-layout%2Cicons-media%2Cicons-moderation%2Cicons-movement%2Cindicators%7Cskins.vector.clientPreferences%7Ctest.GlobalWatchlist%2CMediaWiki%2CVector&version=6cnud:2198:185

anon should not be false in API for non-registered users now, it can be also temp.
I do not know what to do to continue with this patch, without Danny.

P.S. There was another test failure with the same problem, but I could circumvent that test, because it wasn't matter in that case. Not here.

P.P.S. Found the test, it's here, lines 261-280. Still don't know what to do. Possibly, there should be temp: false, between lines 262 and 263, but I do not dare to decide it by myself, from the guess only. Maybe between lines 268 and 269 too.

Well, I took a bold move :-), studied the tests, updated many of them accordingly, returned the circumvention I spoke about back, and explained in commit message. Hope neither the bot or the developers will not find any problems.

IKhitron raised the priority of this task from Medium to High.Nov 30 2025, 8:24 AM

The new patch set has +2 from jenkins-bot. So now, knowing it looks OK, I read the New Developer link you've provided, and many recursive links, and changed the commit accordingly. Waiting for the bot.

Well, it looks fine now. I'd like to recall Sonarqube, but couldn't find anywhere how to do this.

@Pppery, sorry for bothering you, but could you answer, please? The Sonarqube is helpful, but I couldn't find in documentation a way to invoke it by request, now, when the code is ready, and it's very different from the time the bot checked it. Thank you in advance.
UPD: Thank you for helping. The bot worked and approved, the call command was "check codehealth".

FYI: I didn't forget this fask, I'm just looking all this time for some important debugging documentation.

IKhitron changed the task status from Open to Stalled.Dec 6 2025, 12:04 PM

Waiting for T411926.

Test wiki created on Patch demo by IKhitron using patch(es) linked to this task:
https://6f7d1a6ce6.catalyst.wmcloud.org/w/

IKhitron changed the task status from Stalled to Open.Dec 6 2025, 8:22 PM

The "our" part of the bug is resolved, continuing to work.

Test wiki created on Patch demo by IKhitron using patch(es) linked to this task:
https://567e917e4e.catalyst.wmcloud.org/w/

Well, here are my thoughts after trying the Patch Demo:

  1. It allows wikifarm with multiple wikis, but theit addresess are something like https://*.*.*.*/wiki2/<pagename>. So I can't use them as in the extension settings, the syntax can't be understood. And so, I'll use one-wiki demos.
  2. It allows to choose the language code, like en or es, but the code is not delivered to the extension, so it doesn't know to change to rtl.
  3. I decided to have two demos. The first one, with "en" language code and temporal accounts. The second one, with "he" language code and old anonymous users. To see the right RTL, I'll add dir="rtl" manually in developer tools to the second one.

Test wiki created on Patch demo by IKhitron using patch(es) linked to this task:
https://6e6369f88e.catalyst.wmcloud.org/w/

Test wiki on Patch demo by IKhitron using patch(es) linked to this task was deleted:

https://6f7d1a6ce6.catalyst.wmcloud.org/w/

Test wiki on Patch demo by IKhitron using patch(es) linked to this task was deleted:

https://567e917e4e.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by IKhitron using patch(es) linked to this task:
https://a2ebe4b69d.catalyst.wmcloud.org/w/

Most of the patch work. The grey color doesn't. I think I know what is the problem, but can't run Jenkins bot by myself yet to check and try to fix, so I'm just waiting to somebody paying attention.
UPD: Rebuild the demos. The problem isn't what I suspected. Continuing searching.

Done. The patch is ready and waiting for reviewers.

Test wiki created on Patch demo by JHuneidi (WMF) using patch(es) linked to this task:
https://23a351184a.catalyst.wmcloud.org/w/

Test wiki on Patch demo by JHuneidi (WMF) using patch(es) linked to this task was deleted:

https://23a351184a.catalyst.wmcloud.org/w/

IKhitron changed the task status from Open to Stalled.Dec 17 2025, 1:07 PM
This comment was removed by IKhitron.
IKhitron changed the task status from Stalled to In Progress.Dec 17 2025, 1:08 PM

Change #1211732 merged by jenkins-bot:

[mediawiki/extensions/GlobalWatchlist@master] Prepare GlobalWatchlist for IP masking

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

neriah awarded a token.

Test wiki on Patch demo by IKhitron using patch(es) linked to this task was deleted:

https://6e6369f88e.catalyst.wmcloud.org/w/

Test wiki on Patch demo by IKhitron using patch(es) linked to this task was deleted:

https://a2ebe4b69d.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by EBomani-WMF using patch(es) linked to this task:
https://8ac26a7f5f.catalyst.wmcloud.org/w/

Test wiki on Patch demo by EBomani-WMF using patch(es) linked to this task was deleted:

https://8ac26a7f5f.catalyst.wmcloud.org/w/