fix(webui): add UUID fallback for legacy WebViews - #130
Merged
su-fen merged 2 commits intoJul 17, 2026
Conversation
SinclairLin
marked this pull request as ready for review
July 17, 2026 11:15
SinclairLin
marked this pull request as draft
July 17, 2026 11:19
SinclairLin
marked this pull request as ready for review
July 17, 2026 11:19
Member
|
感谢佬为此项目作出的贡献! |
… createUuid Follow-up to the createUuid() fallback: - Replace the leftover `typeof crypto?.randomUUID === "function"` guard + hand-rolled fallback pattern at 12 call sites (GUI: compaction engine, uploaded-file message ids, hosted-search probe ids, right-dock writer id, subagent id suffix, power-activity ids, shell run ids, local gateway chat run ids, gateway bridge worker ids; WebUI: uploaded-file message ids, chat client request ids, right-dock writer id). The typeof guard survives a missing API but still crashes in WebViews where randomUUID exists yet throws when called — the exact scenario createUuid() handles. - Register lib/shared/id.ts in scripts/mirror-manifest.json so CI enforces the two copies stay byte-identical. - Document on createUuid() that the last-resort path is not cryptographically secure and must not be used for security tokens. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
概述
修复旧版或嵌入式 WebView 中 UUID 生成失败的问题,桌面端与 Gateway Web 同步使用兼容的 UUID 生成逻辑。
根因
项目中多处直接调用 crypto.randomUUID()。部分旧版 WebView 不提供该 API,或者虽然暴露了该 API,但实际调用时会抛出异常,导致会话、设置、SSH、文件上传和自动化相关流程无法继续。
改动
用户影响
旧版或能力不完整的嵌入式 WebView 可以继续创建会话、配置供应商、SSH 主机、上传文件和自动化请求;现代浏览器仍优先使用原生 crypto.randomUUID()。
查重
未发现重复 Issue 或 PR;已检索上游仓库中与 UUID、randomUUID、WebView 相关的 Issue 和 PR。
验证