Defect: Autoblock message truncated
Open, Needs TriagePublic


Autoblock messages, as shown on Special:AutoblockList, take the form:
Autoblocked because your IP address has been recently used by [[User:$1|$1]. The reason given for $1's block is: "$2"

The message has been customised on the English Wikipedia to:
Autoblocked because your IP address has been recently used by "[[User:$1|$1]]". The reason given for $1's block is: "'''$2'''".
which doesn't look like it should break anything.

However, as seen in the attached screenshot, the message is truncated for a block on user "எஸ். பி. கிருஷ்ணமூர்த்தி" (might be Unicode-related?) It's not a rendering issue; the rest of the sentence is actually missing from the HTML.

I would expect to see the full message, including the reason for the original block.

The above user's name appears to be handled correctly elsewhere, for example on their user page, logs and contributions.

Gurch created this task.Aug 10 2017, 1:54 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 10 2017, 1:54 PM

The reason field can hold 255 bytes in the database (similar to T6715). it is possible that the comment is truncated there, because the username is using more than one byte per character.

Copy over the api result, because it will disapear when block expired.

    "batchcomplete": "",
    "query": {
        "blocks": [
                "id": 7723799,
                "by": "NativeForeigner",
                "timestamp": "2017-08-10T16:49:49Z",
                "expiry": "2017-08-11T16:49:49Z",
                "reason": "[[Wikipedia:Autoblock|Autoblocked]] because your IP address was recently used by \"[[User:\u0b8e\u0bb8\u0bcd. \u0baa\u0bbf. \u0b95\u0bbf\u0bb0\u0bc1\u0bb7\u0bcd\u0ba3\u0bae\u0bc2\u0bb0\u0bcd\u0ba4\u0bcd\u0ba4\u0bbf|\u0b8e\u0bb8\u0bcd. \u0baa\u0bbf. \u0b95\u0bbf\u0bb0\u0bc1\u0bb7\u0bcd\u0ba3\u0bae\u0bc2\u0bb0\u0bcd\u0ba4\u0bcd\u0ba4\u0bbf]]\". The reason given for \u0b8e\u0bb8\u0bcd. ",
                "automatic": "",
                "nocreate": "",
                "allowusertalk": ""

I would say, no bug, only less space to save the correct reason.

Gurch added a comment.Aug 10 2017, 8:53 PM

OK I see the problem now - I was thinking there weren't enough characters to cause that but those are 3-byte characters in UTF-8.

While not a bug in that case, I would say it is a usability problem for editors affected by such autoblocks, since the message shown to them is truncated (and given a sufficiently long name, the user link would be mangled too).

One option would be to keep the autoblock data in a more structured format, i.e. store the original username and block reason separately, and construct the interface message only when shown to the user. As the username and block reason each fit in 255 byte fields themselves, this would avoid any truncation.

Not sure it's worth the effort though.

TBolliger renamed this task from Autoblock message truncated to Defect: Autoblock message truncated.Jan 12 2018, 11:08 PM