Page MenuHomePhabricator

Users get a welcome message before completing the registration
Closed, ResolvedPublic8 Estimated Story Points

Description

Since T111486: Update Translate to use AuthManager, the sandbox accounts receive a welcome message as soon as they are created, even though they are not approved accounts yet. See https://translatewiki.net/wiki/Special:Contributions/WelcomeMessageBot the messages sent to accounts that were not confirmed.

Presumably this has to do with NewUserMessage's usage of the AddNewAccount hook.

Reported by Keunes:

instead a bot tells me to create my user page - which I cannot b/c I do not have the permission (really?) to do so.

Event Timeline

It's now actually NewUserMessage::onLocalUserCreated which attaches to LocalUserCreated since 25df522f838f6dc403d8a0029217299e8365eebd .

I'm not sure what solution is the cleanest here. Run some hook in NewUserMessage::onLocalUserCreated() to let TranslateSandbox abort the notification in some case and then have ApiTranslateSandbox::doPromote() run LocalUserCreated again? :/

I don't know about the first part, but

and then have ApiTranslateSandbox::doPromote() run LocalUserCreated again

would not be the right thing to do. Don't run the LocalUserCreated hook when the user wasn't really created. Make a "TranslateSandboxUserPromoted" hook and have things hook that, or add the hook in your LocalSettings.php if it doesn't make sense for the other extension to know about TranslateSandbox.

Change 889498 had a related patch set uploaded (by Nikerabbit; author: Nikerabbit):

[translatewiki@master] Remove NewUserMessage

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

Change 889529 had a related patch set uploaded (by Nikerabbit; author: Nikerabbit):

[mediawiki/extensions/Translate@master] Add Translate:TranslatorSandbox:UserPromoted hook

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

Change 889529 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Add Translate:TranslatorSandbox:UserPromoted hook

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

Change 889498 merged by jenkins-bot:

[translatewiki@master] Remove NewUserMessage

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

Nikerabbit triaged this task as Lowest priority.Apr 4 2023, 12:07 PM

This is on my idle task list, hence slow progress. As next step, we can now add code using the new hook that send the message after an user is approved to be a translators.

abi_ set the point value for this task to 8.May 19 2023, 2:12 PM
abi_ subscribed.

I've added some story point. Please update if its too much or inadequate

Wangombe changed the task status from Open to In Progress.Jul 18 2023, 1:44 PM
Wangombe claimed this task.

Status update:

  • The first patch removed the NewUserMessage extension from translatewiki.net. New users no longer receive a message upon sign up.
  • A new hook was added; UserPromotedHook, specifically for translatewiki.net.

I don't think there's any reservations about the message template so it should be left as is.
Pending work:

  • Implement the UserPromotedHook inside TranslatewikiSettings.php. Since the code will be specific to translatewiki.net, most of the of the functionality from the NewUserMessage::class should be ported to TranslatewikiSettings.php for the execution of the hook.
  • Sending a message should be handled using the job queue.

Change 940853 had a related patch set uploaded (by Wangombe; author: Wangombe):

[translatewiki@master] Implement Translate:TranslatorSandbox:UserPromoted hook

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

Change 940853 merged by jenkins-bot:

[translatewiki@master] Implement Translate:TranslatorSandbox:UserPromoted hook

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

Change 947364 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[translatewiki@master] TranslatewikiSettings: Add namespace prefix for MediaWikiServices

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

Change 947364 merged by jenkins-bot:

[translatewiki@master] TranslatewikiSettings: Add namespace prefix for MediaWikiServices

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

Change 947370 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[translatewiki@master] Add the NewUserMessageJob job to $wgJobClasses

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

Change 947370 merged by jenkins-bot:

[translatewiki@master] Add the NewUserMessageJob job to $wgJobClasses

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

Change 947713 had a related patch set uploaded (by Wangombe; author: Wangombe):

[translatewiki@master] TWN: add WelcomeMessageBot link on user welcome message

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

Change 947713 merged by jenkins-bot:

[translatewiki@master] Add link to WelcomeMessageBot user page in welcome message

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

Change 949992 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[translatewiki@master] NewUserMessageJob: Change the signature to add link to user page

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

Change 949992 merged by jenkins-bot:

[translatewiki@master] NewUserMessageJob: Change the signature to add link to user page

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