Skip to content

Show custom emoji as text when a post has more than 100 of them - #2534

Open
meet4731 wants to merge 1 commit into
Dimillian:mainfrom
meet4731:fix/2531-many-custom-emoji
Open

meet4731 wants to merge 1 commit into
Dimillian:mainfrom
meet4731:fix/2531-many-custom-emoji

Conversation

@meet4731

@meet4731 meet4731 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Opening the post from #2531 crashes the app on iPhone. It has 784 custom emoji and every inline emoji adds another level of Text concatenation, which SwiftUI resolves recursively. On a phone the main thread stack is 1 MB and it runs out.

It does not show up in the simulator because the simulator has an 8 MB stack. I relinked with a 1 MB stack to match a device. 300 emoji render fine, 350 crash.

So above 100 emoji we now show the shortcodes as text instead of images. Posts with fewer emoji are not affected.

The proper fix would be in EmojiText, building the Text as a balanced tree instead of a chain. That is a separate repo, so this keeps the app from crashing for now.

Related to #2531

Each inline custom emoji adds a level of Text concatenation and SwiftUI
resolves them recursively. The post from the issue has 784 emoji and
overflows the 1 MB main thread stack on iPhone.

Related to Dimillian#2531
@Dimillian

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants