zulip / zulip-mobile

Zulip mobile apps for Android and iOS.
https://zulip.com/apps/
Apache License 2.0
1.28k stars 643 forks source link

Keypad emoji fail to render (sometimes) #3517

Closed gnprice closed 3 years ago

gnprice commented 5 years ago

We fixed #3129 a while ago, and the keypad emoji work great in a simulated Nexus 5 running Android 9 and a debug build from a recent master:

image

But on my physical Pixel 2 XL, running also Android 9, with the recent release build v25.2.116, I see the symptoms of #3129 almost exactly: on the same messages from the screenshot above,

Perhaps a fonts issue? Note that as our unit tests show:

describe('nameToEmojiMap', () => {
  const check = (name, string1, string2) => {
    expect(string1).toEqual(string2);
    expect(nameToEmojiMap[name]).toEqual(string1);
  }; // ...

  test('works for some multi-codepoint emoji', () => {
    check('0',        '0⃣', '0\u{20e3}');
    check('asterisk', '*⃣', '*\u{20e3}');
    check('hash',     '#⃣', '#\u{20e3}');
  });
});

a keypad emoji like :hash: expands to the plain # character followed by U+20e3... and the latter is

$ unicode u+20e3
U+20E3 COMBINING ENCLOSING KEYCAP

so basically the font used on my phone might lack that combining character.

gnprice commented 5 years ago

Also works great on an iPhone 7 with iOS 12.3.1, running v25.4.118.

gnprice commented 5 years ago

Quick additional bit of data: the webapp in Chrome works great on the same messages and same device where the mobile app has the above symptom. That's my physical Pixel 2 XL running Android 9, with v25.6.120, the latest beta.

gnprice commented 5 years ago

@jainkuniya reported some additional information on #3537, a PR:

On further study, I believe the situation is that the two-codepoint sequence 0030-20e3 is just not a valid emoji sequence according to the spec, and it should be 0030-fe0f-20e3. Details in a subsequent chat thread.

gnprice commented 3 years ago

We've had a new report of this: https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/number.20emoji/near/1167842

That chat thread on #backend back in 2019 didn't result in fixing these sequences on the server, so it's clearly past time we should just override them in the app as a workaround. I've just sent #4693 to do that.