Skip to content

fix(desktop): 机构远程访问配置未传到远控插件(关联 #228) - #231

Merged
freedomkk-qfeng merged 2 commits into
ECNU:mainfrom
JunieXD:fix/remote-access-organization-config
Oct 26, 2026
Merged

freedomkk-qfeng merged 2 commits into
ECNU:mainfrom
JunieXD:fix/remote-access-organization-config

Conversation

@JunieXD

@JunieXD JunieXD commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

问题

桌面配置里的 remoteAccess(机构中继和登录,可写在 eduwork.jsonc 或随签名配置更新下发)一直没有传到远控插件,也没有任何报错。

原因:product-profile.mjs 只把它写给 composition.json 里登记的 eduwork-remote-access。从公版 0.4.8 起,远控改为可选 npm 插件,入口由插件包自带的 patch 插入,不在 composition.json 里,所以这项配置被丢掉了。#192 的单测手动往 composition.json 里加了这一行,绕过了这个情况,所以没有发现。机构版排除预装、由用户自行安装插件时,配置也同样到不了插件。

改动

  • product-profile.mjs:配置了 remoteAccess 时,在产品 patch 里单独写一行 eduwork-remote-access,内容为 organization。原生 profile 中,生成的产品 bundle 总是排在最后,所以无论插件是随产品安装还是用户自行安装,这一行都会作用在插件插入的入口上。用户仍需自己在设置里开启远程访问。在应用运行中才安装插件的,重启后机构中继生效。
  • native-profile.mjs:以前只有新旧两版产品 bundle 都有某一行时,才会把用户保存的配置按新默认值重新合并。现在这一行新出现或被撤掉时,也会重新合并:
    • 新出现:用户之前手动保存过远控设置,配置更新再加上机构中继,中继也能合并进去,不会被整份保存的配置覆盖。
    • 被撤掉:保存配置里复制的机构默认值会被移除,个人设置保留,不会被当成个人设置一直留着,导致之后换中继也无法生效。

验证

  • node --test dsh-host/test/*.test.mjs:178 个通过,18 个跳过(需要完整运行时)。新加的两个测试,不加修复都会失败:
    • 插件由自己的 bundle 插入时,配置里的机构中继能写进产品 patch;
    • 保存配置后,依次加上、撤掉、更换机构中继。
  • 官方 DSH 0.2.1-rc.3:
    • 用插件管理器安装远控插件,并已在设置页保存过自己的中继和接入密钥,再用 writeNativeProfile 写入机构中继后启动,插件状态显示出机构中继;
    • 依次加上、撤掉、换成另一个中继后,插件状态显示新中继;
    • 没有安装远控插件、但带有这一行配置时,DSH 正常启动。
  • 未测:EduWork 桌面成品包上的完整机构登录流程。

关联 #228。

…undle

Since remote access ships as its own npm bundle, its entry comes from the
bundle's patch, not composition.json, so remoteAccess from the desktop
configuration was dropped without a word. The relay is now a row of its own
in the product patch, which reaches the bundle whether it came with the
product or was installed by the user. Saved preferences are now also rebased
when a product row appears or goes, so a configuration update that adds,
withdraws or replaces the relay reaches a computer whose user has already
saved the plugin's settings, and withdrawn defaults do not linger as personal
ones.
@freedomkk-qfeng
freedomkk-qfeng merged commit d479d75 into ECNU:main Oct 26, 2026
4 checks passed
@JunieXD
JunieXD deleted the fix/remote-access-organization-config branch October 28, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants