Page MenuHomePhabricator

Update block message to clarify duration
Closed, ResolvedPublic

Description

Motivation

We introduced a throttle for temporary account creation (T405565) but did not update the block message on wiki to reflect the change. As a result, the message that users see when throttled is incorrect:

image.png (802×1 px, 333 KB)

Acceptance criteria
  • Update acct_creation_throttle_hit to Visitors to this wiki using your IP address have created {{PLURAL:$1|1 account|$1 accounts}} in the last $2, which is the maximum allowed in this time period.\nAs a result, visitors using this IP address cannot create any more accounts at the moment. where $2 can be "10 minutes" or "24 hours"

Event Timeline

Niharika triaged this task as High priority.

Screenshot with revised text:

image.png (578×1 px, 146 KB)

Change #1196487 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/WikimediaMessages@master] acct_creation_throttle_hit: Add second parameter for duration

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

Noting that I just received a community question about this :). It looks like the error message is way less confusing in the newer form, thank you for working on this!

Change #1196487 merged by jenkins-bot:

[mediawiki/extensions/WikimediaMessages@master] acct_creation_throttle_hit: Add second parameter for duration

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

Noting that I just received a community question about this :). It looks like the error message is way less confusing in the newer form, thank you for working on this!

Thanks for passing along feedback.

Can you please clarify more about parameter $2? What kind of values can it have?

In English, the word "last" can work with any period, but in many languages, different words will be needed.

Can you please clarify more about parameter $2? What kind of values can it have?

In English, the word "last" can work with any period, but in many languages, different words will be needed.

It's a duration, the relevant PHP code is this if it helps:

public static function durationParam( $duration ): ScalarParam {
		return new ScalarParam( ParamType::DURATION_LONG, $duration );
	}

The acct_creation_throttle_hit message has existed in core with the $2 parameter for a long time, so there are many translations that make use of this parameter already.

The acct_creation_throttle_hit message has existed in core with the $2 parameter for a long time, so there are many translations that make use of this parameter already.

Thanks. It clarifies it a bit, but it's not perfect. There should probably be a new function in the Language class that handles sentences with the word "last", because the current one is really insufficient. Or something along these lines. I'll report a separate task.

@Niharika
New Code Changes have been implemented, and verified.

What I have noticed during testing:

Item 1:
I am able to produce the updated error message when the same IP Address has been used to create 6 accounts in the last 1 day:
Visitors to this wiki using your IP address have created 6 accounts in the last 1 day, which is the maximum allowed in this time period. As a result, visitors using this IP address cannot create any more accounts at the moment. If you are at an event where contributing to Wikimedia projects is the focus, please see Requesting temporary lift of IP cap to help resolve this issue.

But if I then Clear my Cache or Clear Site Data, and then try to create another temporary account, it will then display the error message regarding creation of 1 account in the last 10 minutes, instead of displaying the same error message for 6 accounts created in the last 1 day:
Visitors to this wiki using your IP address have created 1 account in the last 10 minutes, which is the maximum allowed in this time period. As a result, visitors using this IP address cannot create any more accounts at the moment. If you are at an event where contributing to Wikimedia projects is the focus, please see Requesting temporary lift of IP cap to help resolve this issue.


Item 2:
In regards to the error message for 6 accounts created in the last 1 day, the Acceptance Criteria in the ticket description says 24 hours...
So is the Acceptance Criteria incorrect/outdated, and therefore what I am seeing in testing last 1 day is the correct verbiage?
OR should it be saying last 24 hours?
OR should it be saying last day?


Item 3:
I have noticed that when I get the 6 accounts in the last 1 day message, and then click the button Try Again or click the button Dismiss, it then switches to the message regarding 1 account created in the last 10 minutes.