refactor: generate cold-start routes at build time for v6.5.0 (OK-57861)#12542
Open
huhuanming wants to merge 16 commits into
Open
refactor: generate cold-start routes at build time for v6.5.0 (OK-57861)#12542huhuanming wants to merge 16 commits into
huhuanming wants to merge 16 commits into
Conversation
huhuanming
marked this pull request as ready for review
July 17, 2026 10:50
huhuanming
requested review from
ezailWang,
originalix,
revan-zhang and
sidmorizon
as code owners
July 17, 2026 10:50
huhuanming
enabled auto-merge (squash)
July 17, 2026 10:50
originalix
reviewed
Jul 18, 2026
| { | ||
| name: EModalSignatureConfirmRoutes.TxConfirm, | ||
| component: TxConfirm, | ||
| allowColdStart: true, |
Collaborator
There was a problem hiding this comment.
当外部 URL/hash 直接指向 TxConfirm、TxAmountInput、TxReplace 等内部步骤时,allowColdStart: true 会让 linking config 接受该路径。
这些页面依赖结构化交易对象、数组和回调,并会直接读取或解构 route.params;这些状态无法由 URL query 重建,因此会进入无效签名流程或直接崩溃。Navigator 内部能够导航到这些页面,并不要求它们成为冷启动入口。
请只为真实的外部入口保留 allowColdStart,例如 TxConfirmFromDApp、MessageConfirmFromDApp 和实际使用的 LNURL/WebLN 页面,并让内部确认、编辑和选择步骤不进入 linking manifest。
originalix
reviewed
Jul 18, 2026
| } | ||
| : undefined, | ||
| ].filter(Boolean); | ||
| { |
Collaborator
There was a problem hiding this comment.
当非 Extension 客户端收到 /permission/web-device 时,这个无条件根路由会让 Web、Desktop 和 Native 都解析并打开 WebUSB 权限页。
该页面直接调用 navigator.usb.requestDevice();Native 或不支持 WebUSB 的环境没有对应能力,会进入不可用页面并抛出错误。这里原本的平台条件同时也是路由安全边界。
请恢复 platformEnv.isExtension 限制,并让生成的各平台 manifest 保留这一差异,只在 Extension 目标接受该路径。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OK-57861
Summary
Backports the complete fix from #12496 to
release/v6.5.0.resolveScreensimplementationWhy
Runtime route discovery kept route modules in the cold-start dependency graph and made generated route coverage harder to audit. Some strongly typed onboarding routes could also mount with missing or malformed URL parameters.
This backport makes the route topology deterministic at build time, reduces production cold-start exposure, and fails closed for sensitive route inputs without changing established displayed URLs.
Impact
Port notes
The 16 commits from #12496 were replayed in order onto the latest
release/v6.5.0. The only conflict was inpackages/kit/src/routes/config/index.ts; the resolution preserves the release branch's Web DApp fallback and adds the backportedresolveScreensimport.Validation
yarn install --immutable --inline-buildsyarn routes:generateyarn routes:checktsgo --noEmitgit diff --checkyarn agent:check --profile commitstill hits the Windows child-process spawn issue documented in #12496; its underlying route generation, lint, tests, and TypeScript checks were run directly and passed.