Repository navigation
fix(remote-access): 运行中安装插件后远端无法确认预览版说明(修复 #229) - #230
Merged
freedomkk-qfeng merged 1 commit intoOct 26, 2026
Merged
Conversation
…ransaction A plugin installed or enabled while DSH runs is loaded inside DSH's configuration transaction, so the async context captured at load still carried it, and a paired device's settings write (acknowledging the preview notice) was refused as nested until DSH restarted. Remote access now also leaves that transaction when it starts. Fixes ECNU#229
This was referenced Oct 26, 2026
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.
问题
修复 #229:在 DSH 运行中安装或启用远控插件后,手机配对成功,但点“预览版说明”的“继续”时提示“暂时无法保存确认状态”,刷新也进不去;重启应用后恢复正常。
原因
DSH 用
AsyncLocalStorage标记配置事务,在事务里再写设置会以HMR transactions cannot be nested拒绝。插件管理器安装和启用插件都在hmr.runExclusive里进行,所以插件模块在事务里加载,加载时记下的上下文(AsyncLocalStorage.snapshot())也带着事务标记。远程访问在这个上下文里启动,手机的每个请求都会继承它,于是settings/mutate被拒绝。重启后插件在启动阶段加载,不在事务里,所以问题消失。改动
hmr.executing.exit)。没有 hmr 服务时行为不变。门禁规则不变,远端仍只能写welcomeNoticeVersion这一项设置。executing在 DSH 的类型声明里是私有字段,DSH 没有提供其他离开事务的办法。代码注释写明了这一点,并注明已在 0.2.1-rc.2、rc.3 上核对。[true, undefined](事务标记泄漏)。验证
npm run check(packages/dsh-remote-access):73 个测试通过。pluginManager/installBundle安装 0.1.1,手机点“继续”失败,返回settings/rejected: HMR transactions cannot be nested;重启 DSH 后成功。Fixes #229