fix: 完善 WebUI 连接错误提示与后端端口占用处理 - #88
Open
Aibeto wants to merge 10 commits into
Open
Conversation
1. 新增带超时的fetch方法避免连接卡死,完善版本校验逻辑 2. 格式化代码 3. 新增pnpm工作空间配置文件,虽然实pnpm@8似乎并不需要,但是我一开始没注意到这一点,使用了pnpm@11,就当是战未来了(?
将generator-function的依赖资源加入到win、mac、linux三个平台的打包assets配置中,确保打包时可以正确携带该依赖 但是我确实没搞明白在没有这条的情况下为什么也有办法正常构建运行(
1. 修复VSCode TypeScript默认格式化器配置 2. 给pnpm工作区添加根包配置 3. 优化端口占用错误处理,添加1秒延迟后退出进程 4. 清理多余空白字符与导入冗余代码
1. 修正了ServeiceBridge的拼写错误为ServiceBridge 2. 新增直接读取errno异常码来检测EADDRINUSE和EACCES错误,替代原有的字符串匹配方式,提升检测准确性
1. 注释掉端口启动失败时的原始error日志输出 2. 补充版本不匹配错误的场景说明,包含非FFBoxService端口情况
Owner
|
不建议在没有实际功能变动的地方修改代码格式,这会使代码历史变得混乱,review 难度增加。 另外,“后端”是一个相当广泛的概念,语义精准性和普及程度是不如“服务器”的。如果文案中并非与“前端”形成对应关系,尽量保持“服务器”的称呼。注意文案中存在中英文之间缺失空格的情况。在未来有更好的方案解决这种格式问题之前还需保持这种习惯。 如非必要,不应新增或变更配置项和依赖。新增配置项或变更依赖容易导致技术债的堆砌,往往需要在后期反复检查为何引入某配置项(如 prettier)。对这些的行为应有明确的用途说明,以便后期排查问题。 |
在ws的close和error事件处理中添加清除连接超时定时器
- 回退到 is-generator-function@1.1.0
- 删除声明包根目录 + allowBuilds(electron/utimes/vue-demi),撤销config/pkg.${platform}.config.json修改
统一typescript和javascript的代码格式化工具为prettier-vscode
Author
依据 review 反馈 的修改
|
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.
变更内容
前端(serviceBridge.ts)
onerror回调补充connectResult(false),修复连接状态在部分场景下可能卡死在Connecting的问题后端(uiBridge.ts)
依赖与构建配置
pnpm-workspace.yaml,声明 allowBuilds(electron、utimes、vue-demi).vscode中TypeScript默认格式化器更换为内置格式化器,serviceBridge.ts与appStore.ts中的大量变更来自格式化重排appStore.ts中版本提示文案由"服务器"调整为"后端",与实际架构表述一致已知问题
uiBridge.ts#L208和L209的sleep和process.exit(1)不生效服务器 未连接 连接失败:前后端版本不匹配或端口非FFBoxService服务(前端 6.0-alpha ,后端 OK )的难绷的消息