Skip to content

[Bug] 插件控制台「检查更新」永远无结果(registry 有新版也 latest:null,无失败提示) #13

Description

@spacexun2

现象

设置页「插件控制台」点「检查更新」不出现可更新项,也没有任何失败提示。POST /api/plugin-console/versions/refresh 返回 ok: true,但 registry 上确实有新版的包也全部返回 latest: null

复现响应

安装若干 registry 上有新版的包后点「检查更新」,响应形如:

{
  "ok": true,
  "packages": {
    "dsh-monitor": { "latest": null, "checked": true },
    "@linxin666/dsh-client-ui-skin-center": { "latest": null, "checked": true },
    "@linxin666/dsh-client-ui-web-ui-settings": { "latest": null, "checked": true },
    "dsh-web-terminal": { "latest": null, "checked": true },
    "dsh-loop": { "latest": null, "checked": true },
    "whale-girl": { "latest": null, "checked": true },
    "@dsh-external/plugin-console": { "latest": null, "checked": true }
  }
}

这些包在 registry 上均有新版本,但全部 latest: null,且 UI 无任何失败提示。

根因

src/index.tsnpmViewLatestspawnSync('npm', ['view', name, 'version'], { stdio: ['ignore', 'pipe', 'pipe'] }) 查询版本:

  1. Windows 下裸名 npm.cmd 垫片spawnSync 不做 shell 解析,直接 ENOENT;
  2. 受限宿主环境(sandboxed host) 子进程管道捕获被拦截(EPERM);
  3. 失败被空 catch 折叠成 null,且照常写缓存 → UI 显示「已检查」,用户无法区分「已最新」「本地包」「检查失败」三种状态。

修复

PR #12 已提交:改用原生 fetch 查询 registry JSON API(404 = 非 registry 包;错误显式化并记录日志;响应带 error 字段),另含设置页重复 tab 修复。


AI 辅助提交(模型 DeepSeek、工具 DeepSeek Harness)。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions