Skip to content

fix(mobile): initialize text decoding before client startup - #479

Draft
harryisfish wants to merge 4 commits into
mainfrom
fix/mobile-text-decoder
Draft

harryisfish wants to merge 4 commits into
mainfrom
fix/mobile-text-decoder

Conversation

@harryisfish

@harryisfish harryisfish commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Why

iOS Release 启动时,共享客户端顶层创建 TextDecoder,但 Hermes 没有提供该全局对象,导致应用立即退出。

What changed

  • 在 Expo Router 前加载移动端 polyfills,并安装仅支持 UTF-8 的 TextDecoder。
  • 保留 fatal 解码及已有全局实现。
  • 添加从真实应用入口加载安装器和共享模块的聚焦检查,补充真机启动检查说明。

Scope

移动端 JavaScript 初始化。没有更改协议、存储或设备身份。

Verification

修复前检查复现缺少 TextDecoder;修复后启动检查和移动端类型检查通过。独立审查无 P0-P3,并通过 75,536 组 UTF-8 对照检查。配置的 CI 策略自检、Web 构建与打包资源进程检查、静态官网检查通过。已合入最新主分支 b5bc2a2,当前提交 5ab14fd,发行版本 0.0.1-nightly.20261106.3。底层库按 iOS 16.4 最低版本构建,当前 iPhone Release 已编译成功,包内源码标记与发行版本已核验。

已在物理 iPhone 17 Pro Max 完成签名校验、覆盖安装和启动验收;消息列表正常显示,进程持续存活。最终提交 Mobile CI Android 通过,iOS 模拟器 UI 因 daemon-rpc 超时失败,未当作通过。PR 保持 Draft。

Owner: harryisfish.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stale comment

这次不合并。和当前 main 在 apps/mobile/app/_layout.tsx、apps/mobile/package.json 和 packages/docs/e2e.md 冲突。当前入口已经是 expo-router/entry,polyfill 由根布局引入,不再是这个分支上的 index.ts。

Hermes 缺 TextDecoder 这件事在 main 上还在:packages/client/src/lib/secure.ts 和 transport.ts 在模块顶层就构造 TextDecoder,手机根布局会引入它们,而 polyfills.ts 只补了 crypto。旧记录里的真机通过属于旧 head,iOS 模拟器 UI 并未通过。先按当前入口重做,再用当前 head 验收启动。在那之前不另开第二个同主题 PR。

View PR

Open in Web View Automation 

Sent by Cursor Automation: Vibeface 清理

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stale comment

本轮不合并。

对照 main @ 4ca16a8d:Hermes 启动崩溃根因还在。packages/client/src/lib/secure.ts 和 transport.ts 仍在模块顶层构造 TextDecoder;polyfills.ts 只补了 crypto 和 URL;入口仍是 expo-router/entry,polyfill 只挂在 _layout。GitHub 现在显示 MERGEABLE,但分支落后 main 约 58 个提交,仍是 Draft。

本 PR 用 index.ts 在 Router 之前安装 @bacons/text-decoder 仍是对症方案。旧记录里的真机通过属于旧 head,iOS 模拟器 UI 当时也没通过。清理轮次不代合并、也不另开第二个同主题 PR。请先 integrate 最新 main,跑 test:polyfills 与真机冷启动,通过后再去 Draft。

View PR

Open in Web View Automation 

Sent by Cursor Automation: Vibeface 清理

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stale comment

本轮不合并。

对照 main @ 9300b1f:仍是 Draft,现已 CONFLICTING。Hermes 缺 TextDecoder 的根因还在:packages/client/src/lib/secure.ts 和 transport.ts 仍在模块顶层构造 TextDecoder;polyfills.ts 只补了 crypto 和 URL;入口仍是 expo-router/entry。

在 index.ts 里、Router 之前安装 @bacons/text-decoder 仍是对症方案。旧真机记录属于旧 head。请先 integrate 最新 main,跑 polyfill 检查和冷启动,通过后再去 Draft。清理轮次不另开第二个同主题 PR。

View PR

Open in Web View Automation 

Sent by Cursor Automation: Vibeface 清理

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stale comment

本轮不合并。

对照 main @ 8a06a332:仍是 Draft 且 CONFLICTING。Hermes 缺 TextDecoder 的根因还在:packages/client/src/lib/secure.ts 和 transport.ts 仍在模块顶层构造 TextDecoder;polyfills.ts 只补 crypto 和 URL;入口仍是 expo-router/entry。

这仍是对症方案。不另开同主题 PR。请作者按当前 main 重做后标 Ready,并在当前 head 上重跑移动端启动检查。

Open in Web View Automation 

Sent by Cursor Automation: Vibeface 清理

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stale comment

本轮不合并。

仍是 Draft。Hermes 缺 TextDecoder 在当前 main 上还在:packages/client/src/lib/secure.ts 和 transport.ts 在模块顶层构造 TextDecoder;apps/mobile/src/platform/polyfills.ts 只补 crypto 和 URL。不另开同主题 PR。

描述里的真机记录属于旧基线 b5bc2a23。请作者按当前 main 重验吮并标 Ready。清理轮次不接走 Draft。

View PR

Open in Web View Automation 

Sent by Cursor Automation: Vibeface 清理

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stale comment

本轮不合并。

仍是 Draft,对照 main @ 07191092 为 CONFLICTING。Hermes 缺 TextDecoder 在当前 main 上还在:packages/client/src/lib/secure.ts 和 transport.ts 仍在模块顶层构造 TextDecoder;apps/mobile/src/platform/polyfills.ts 只补 crypto 和 URL;入口仍是 expo-router/entry。

这仍是对症方案,不另开同主题 PR。请作者从当前 main 重做并提供当前 head 的启动验收。不把 Draft 改成 Ready。等下一轮。

View PR

Open in Web View Automation 

Sent by Cursor Automation: Vibeface 清理

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

本轮不合并。

仍是 Draft,对照 main @ 4ee0dcf2 为 CONFLICTING。Hermes 缺 TextDecoder 的根因还在:packages/client/src/lib/secure.ts 和 transport.ts 在模块顶层构造 TextDecoder;mobile polyfill 只补 crypto/URL;入口仍是 expo-router/entry。在 Router 之前安装解码 polyfill 仍是对症方案。请作者自行 rebase 并完成真机验收。不会接管 Draft,也不会另开同主题 PR。

Open in Web View Automation 

Sent by Cursor Automation: Vibeface 清理

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.

1 participant