Skip to content

fix(iOS): support Unicode tab keys in Fabric events - #611

Open
oleksandrzavarzin-callstack wants to merge 6 commits into
callstack:mainfrom
oleksandrzavarzin-callstack:codex/fix-560-unicode-tab-key
Open

oleksandrzavarzin-callstack wants to merge 6 commits into
callstack:mainfrom
oleksandrzavarzin-callstack:codex/fix-560-unicode-tab-key

Conversation

@oleksandrzavarzin-callstack

Copy link
Copy Markdown
Contributor

Fixes #560. It is a continuation of @thiagobrez's work from #563.

Summary

On Fabric, the tab selection and long-press events converted the tab key with cStringUsingEncoding:kCFStringEncodingUTF8. That method expects an NSStringEncoding, so it returned NULL for any non-ASCII key, and the std::string constructor aborted the app. Both events now use std::string([key UTF8String] ?: "").

Changes on top of #563:

  • The verification artifacts (artifacts/issue-560/) are removed from the repository.
  • The branch is merged with main. The e2e flow is now in packages/example-shared/e2e/.
  • The example keeps the "Albums" label. Only the route name changes to 앨범, so the route key is non-ASCII.
  • The flow uses ${APP_ID} like the other flows, and it finds tabs by their label.

Results

Tested on iPhone 17 simulators with iOS 27.0.

Before (native code from main) After (this PR)
SuQyOoAwC5pYm9c41Zj-FQ.mp4
cIPRdHY32xgHZbGCyvpSVQ.mp4

Additional testing results:

iOS 26.5 iOS 27.0
1.5.0, tap on 메시지, Café or 🙂 SIGABRT in onPageSelectedWithKey: SIGABRT in onPageSelectedWithKey:
This fix, taps correct route, no crash correct route, no crash
This fix and #587, long presses correct route, no crash correct route, no crash
unicode-tab-key.yaml with the fix not run passes
unicode-tab-key.yaml without the fix not run fails: the app crashes on the Albums tap

Without #587, long presses do not reach this code on iOS 26 and later (#573).

@oleksandrzavarzin-callstack oleksandrzavarzin-callstack changed the title Fix unicode tab key fix(iOS): support Unicode tab keys in Fabric events Oct 30, 2026
Comment on lines +60 to +64
name="앨범"
component={Albums}
options={{
tabBarButtonTestID: 'albumsTestID',
tabBarLabel: 'Albums',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a new example page for this called "Unicode" or something similar, so we don't pollute the old example. You can copy-paste this one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the comment.
I've added a new "Unicode" example screen.

This branch has not been deployed

No deployments
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.

[iOS] Fabric: SIGABRT on tab press when tab key contains non-ASCII characters (kCFStringEncodingUTF8 passed to -cStringUsingEncoding:)

2 participants