Page MenuHomePhabricator

Incorrect order of elements in email subject when username is RTL
Closed, ResolvedPublic

Description

I've just received this e-mail, not sure if the subject is okay.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Aklapper renamed this task from Weird e-mail subject when username is RTL to Incorrect order of elements in email subject when username is RTL.Mar 22 2016, 9:59 AM

Hi @Sjoerddebruin, thanks for taking the time to report this!

Does it display correctly in other email applications?
Could you provide the raw Subject header line from the email source?

Sjoerddebruin added a comment.EditedMar 22 2016, 10:06 AM

Hi @Sjoerddebruin, thanks for taking the time to report this!

Does it display correctly in other email applications?
Could you provide the raw Subject header line from the email source?

Mail.app (default OS X application):

  • List of messages: wrong
  • Titlebar standalone window: wrong
  • Graphical message header: good

Raw subject:

?UTF-8?Q?=D7=9E=D7=A8=D7=9B=D7=96=20=D7=9E=D7=99=D7=93=D7=A2=20=D7=94=D7=A8=20=D7=94=D7=96=D7=99=D7=AA=D7=99=D7=9D=20heeft=20u=20bedankt=20voor=20uw=20bewerking=20op=20Wikidata?=

This is almost certainly a bug in your email client, but we may be able to get more email clients to behave well by using LRE/RLE characters. This will happen automatically once T121067: Write email formatter that uses presentation models is done.

Checked in betalabs. gmail still shows the reported issue:


Some other examples:

When a topic title is entirely in RTL - all seems to be correct:

We hoped it would be fixed by the @Catrope 's <bdi> work in the presentation models.

@Mooeypoo do you know what the problem is, based on the above screenshots?

We hoped it would be fixed by the @Catrope 's <bdi> work in the presentation models.

Not <bdi> actually, but LRE/RLE characters (Language::embedBidi()).

@Mooeypoo do you know what the problem is, based on the above screenshots?

You can see that it works correctly in the body, just not in the subject. So either we are not putting these LRE/RLE characters in the subject line, or gmail is stripping/ignoring them. Or maybe putting LRE/RLE in subject lines just doesn't work generally.

Etonkovidova added a comment.EditedMay 24 2016, 6:23 PM

Here is email source example:

To: =?UTF-8?Q?=D7=A9=D7=99=D7=97=D7=AA=20=D7=95=D7=99=D7=A7=D7=99=D7=A4=D7=93=D7=99=20=D7=96=D7=A8=D7=99=D7=9E=D7=94?= <etonkovidova@wikimedia.org>
Subject: =?UTF-8?Q?=E2=80=AAET82=E2=80=AC=20replied=20in=20"=E2=80=AB=D7=96=D7=94=20=D7=90=D7=AA=D7=A8=20=D7=91=D7=93=D7=99=D7=A7=D7=95=D7=AA=20=D7=9C=D7=AA=D7=9B=D7=A0=D7=94=20=D7=A9=D7=9C=20=D7=95=D7=99=D7=A7=D7=99...=E2=80=AC".?=
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="=_5770874882495b72fb68d207c479b63f"
From: =?UTF-8?Q?=D7=95=D7=99=D7=A7=D7=99=D7=A4=D7=93=D7=99=D7=94?= <wiki@wikimedia.org>
Reply-To: No Reply <wiki@wikimedia.org>
Date: Tue, 24 May 2016 02:03:50 +0300
Message-ID: <hewiki.57438c56e90799.23181211@he.wikipedia.beta.wmflabs.org>
X-Mailer: MediaWiki mailer
List-Unsubscribe: <http://he.wikipedia.beta.wmflabs.org/wiki/%D7%9E%D7%99%D7%95%D7%97%D7%93:%D7%94%D7%A2%D7%93%D7%A4%D7%95%D7%AA>

--=_5770874882495b72fb68d207c479b63f
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8

=E2=80=AAET82=E2=80=AC replied in "=E2=80=AB=D7=96=D7=94 =D7=90=D7=AA=D7=A8=
 =D7=91=D7=93=D7=99=D7=A7=D7=95=D7=AA =D7=9C=D7=AA=D7=9B=D7=A0=D7=94 =D7=A9=
=D7=9C =D7=95=D7=99=D7=A7=D7=99...=E2=80=AC".

Looks like the email does contain LRE/RLE characters in the subject line, so this is probably a bug in GMail then. Does this work correctly in other email clients?

@Etonkovidova, were you able to answer Roan's question?

Does this work correctly in other email clients?

Checked in mail.com and mail.com in Mail app (Mac default mail client) - a subject line and the body text are correctly represented.
It seems as a genuine gmail bug

So, the gmail message with incorrect subject when forwarded

becomes correctly displayed in mail.com

The most interesting cases happen when the subject line is mixed with LTR words in the middle - the phrase will be displayed

jmatazzoni closed this task as Resolved.Jun 1 2016, 9:17 PM
jmatazzoni claimed this task.

How is this "resolved"?

How is this "resolved"?

This is fixed in most desktop email clients, it just isn't fixed in GMail. This is due to a bug in GMail, not in our code. So we've done what we can, and the remainder is a GMail issue.

(@Etonkovidova only included screenshots of the brokenness in GMail, but she showed me the same email in the Mac OS Mail application, and it looks good there.)

I tested in Thunderbird and it works well there, although we should really have quotes in this message. The HTML version uses bolding, but that is stripped in the plan text version.

I just realized we now have the ability to have different messages for email subjects. We should use that for these kinds of messages regardless, because "Etonkovidova thanked you for your comment in Foo on Bar on Baz" is ambiguous without bolding, and we should add quotes there. But going beyond that, we could consider rewording some email subject lines to work around the GMail bug.