bluesky-social / social-app

The Bluesky Social application for Web, iOS, and Android
https://bsky.app
MIT License
13.51k stars 1.73k forks source link

Flag emoji is broken in profile description #818

Open alimony opened 1 year ago

alimony commented 1 year ago

Describe the bug

I see a broken flag emoji in my profile description, which I've had that for a long time so I think it's recent bug:

Screenshot 2023-05-31 at 16 48 09

The last char is supposed to be the Belgian flag.

To Reproduce

Steps to reproduce the behavior:

  1. View this profile: https://bsky.app/profile/markus.polyscopic.works

Expected behavior

All the flags used to show, now the last one is broken.

Details

Additional context

This is broken on iOS too. If I edit the description, the flag displays correctly in the editor, but re-saving does not fix the issue.

alimony commented 1 year ago

My hunch here is that the length enforcement in the client is more naive about UTF than the backend. For example, that the client allows a certain number of characters but the backend a certain number of bytes, causing the backend to drop a few bytes at the end. If the very last character is a four-byte char like an emoji, it breaks.

alimony commented 1 year ago

I just tried removing some chars from the start of the description, and then the last emoji saves just fine. This makes my hypothesis even more likely.

alimony commented 1 year ago

Here's another interesting find that reproduces the error. Setting this as your description works:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa🇧🇪`

(248 times letter "a", then a flag emoji)

But setting this fails:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa🇧🇪

(249 times letter "a", then a flag emoji)

In the latter case, the description is saved as:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa🇧

(249 times letter "a", then only the first regional indicator U+1F1E7 with the second one U+1F1EA missing)

Sininini commented 1 year ago

Bumping and adding my thoughts. They work in Android app, but not in the website. It's not just inside profiles, it happens with posts as well. It's also not just flag emojis, some normal face emojis do it as well.

Here's what it looks on Android app: 2023-09-17 20 52 40-1 On website: chrome_YvpwinCFzf

Also I can't even add flag emojis on the website, both site and Windows emoji picker don't even offer flags. Windows emoji picker doesn't offer them elsewhere either so that's weird and a Windows issue.

Sininini commented 1 year ago

Even Bsky team members use emoji that do not work in desktop Chrome browser: https://bsky.app/profile/rose.bsky.team/post/3kc4u3xtuse2d

pfrazee commented 1 year ago

eugh