Repository navigation
fix(browser): rediscover Desktop bridge after normal restart - #7
Merged
Merged
Conversation
Adapt stable loopback discovery from omdsh-dev#127 and reconnect rediscovery from omdsh-dev#107 while preserving the fork's Gateway, manual addresses, and connection ownership.
LiuRJ99
pushed a commit
that referenced
this pull request
Nov 6, 2026
content-selection.spec.ts 每个用例都新建 SelectionWatcher 但从未 disarm。 watcher 残留的 selectionchange 监听与 debounce 定时器可能跨到 jsdom 环境销毁 之后才触发,CI 偶发报 unhandled ReferenceError: document is not defined (run #7 的 clean-install 即因此失败)。改为在 afterEach 统一 dispose。
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.
DSH Desktop 用
--port 0启动 Web 服务,重启后实际桥地址可能改变。扩展原先只发现固定端口并持续重试旧地址;桥插件正常退出时又复用了表示其他浏览器接管的关闭码,扩展因此停止重连。桥插件现在默认在
127.0.0.1:43189/ext/bridge-config发布当前 WebSocket 地址。扩展自动模式连续探测失败三次后重新发现地址;桥地址留空并保存即可跟随 Desktop 的端口变化。正常退出使用可重连的关闭码1001,另一浏览器接管仍使用4000,避免客户端反复抢占连接。discoveryPort默认43189,0禁用;只提供 GET/HEAD 地址查询,不返回凭据,也不代理 API 或 WebSocket。选择性适配上游 omdsh-dev/dsh-browser#127 的发现入口(
dc8f9fddf623c9a3e2da54f66768bad7ef674833),以及 #107 的重新发现逻辑(38bc801502d82946fa3020fad2592421b4202595)。omdsh-dev#127 的 Peer 修复已有对应实现;omdsh-dev#107 的大范围端口扫描和缓存机制未引入。正常退出关闭码修复由 Desktop 实测发现并补充。验证:最新提交
256733493119dca239ed28b5f19aaaae129da7c7的 CI 全部通过:原始锁文件全新安装、依赖一致性、类型检查、563 项测试、桥插件及 Chrome 构建、完整官方 npm Host 安装与业务冒烟(SDK0.2.1-rc.1)。回归明确覆盖真实服务关闭码1001、接管关闭码4000、客户端正常退出后的重新发现,以及租约与取消竞态。测试包 v0.1.16-dev.2 已发布:bridge
0.0.16-dev.2,Chrome manifest0.1.16,固定 tag 受更新和删除保护。发布包下载回校验、运行时入口与依赖解析均通过。Desktop0.2.1-rc.2候选验证覆盖两次动态端口启动、无待加载插件和成功的session.list业务结果;真实 Chrome 侧栏保持打开,Desktop 正常退出显示重连,重启改变 Web 端口后自动恢复已连接,期间未重载扩展或修改地址。Firefox 仅有共享源码测试,未实测浏览器安装。v0.1.16-dev.1已注明被此版本替代;目录的固定安装来源与校验值同步为 dev.2。