Repository navigation
Desktop in-app update always fails: desktop update: task inspection timed out (0.2.1-rc.5 & 0.2.2-rc.1)
#12434
Replies: 3 comments
|
这个 10 秒不是更新包的问题,是"锁住准入后等所有在途请求排空"没排完。 超时点在哪
Host 侧为什么可能答不上来
const pendingRequests = new Set<Promise<void>>()
ctx.on('connection/request', async (_request, response, next) => {
if (locked) { response.writeHead(503); response.end(); return }
const finished = Promise.withResolvers<void>()
pendingRequests.add(finished.promise)
try { await next() } finally { pendingRequests.delete(finished.promise); finished.resolve() }
})
locked = true
const generation = ++lockGeneration
// Read requests are not tasks; admitted writes must finish before the final work check.
await Promise.all(pendingRequests)也就是说它会等所有已准入的请求结束,而注释说的是"只有写入需要等待"。只要有一个长生命周期或卡住的 HTTP 请求还没结束(流式响应、没关的上传、一个一直挂着的 fetch), 怎么自证 点"安装并重启"的瞬间看 DevTools 的 Network:有没有一条 pending 的请求(尤其是 修法形状:把等待集合从"所有准入请求"收窄到"写入类请求",和注释一致;或者给排空加一个比壳侧更短的内部截止时间并用 503 明确拒绝,而不是让壳侧超时。 只读了 master |
补充:Windows x64 的运行时定位与最小回归验证本机在官方 Windows x64 运行时观察到: 同时有插件界面已经建立的 GET SSE 事件订阅(响应类型为 针对同一个打包函数,使用真实本地 HTTP 服务、持续持有并读取的 SSE,以及尚未完成的普通 POST,做了以下匹配输入验证:
临时修正在真实旧进程中也让 lock 正常返回过 升级后 建议保留的安全边界: 应区分常驻只读订阅与尚未完成的普通操作;不能在固定等待后无条件跳过 pending,也不能将未知状态或超时直接当成“没有任务”。另外,若错误能区分 此补充仅包含技术摘要,没有上传私人聊天、账户、凭据、原始用户数据或二进制文件。 |
|
Cross-reference with a confirmed third-party plugin trigger: #13773. Summary of what it adds to this thread: the drain is blocked by any It also notes that job-izing slow handlers does not help, since a |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Environment
CFBundleShortVersionString=0.2.1-rc.5)this.control({type:"update-tasks",...}, 1e4, "desktop update: task inspection timed out", "desktop update")inlib/main.js)The update package itself downloads fine and its sha512 matches the feed, so this is
neither a network nor an integrity problem.
Steps to reproduce
main window. Keep the window open.
inbox, no running/stopping background job. (The failure also happens with work in
progress — it does not depend on task state.)
panel.
left uninstalled:
Expected: the shell confirms there is nothing to interrupt, stops the Host,
installs the pending update, and relaunches.
Actual: it fails every time, at the same ~10 s mark, and the update stays in the
updater's
pendingcache.Frequency: 100% — every attempt, on both 0.2.1-rc.5 and 0.2.2-rc.1 (after
upgrading by hand, the in-app updater still fails the same way).
Analysis
installDesktopUpdateTaskControlin@deepseek-ai/dsh-desktop-host/lib/index.js(the code is identical in 0.2.1-rc.5 and 0.2.2-rc.1 — I extracted both
app.asararchives and diffed the function; no changes):
Every request admitted through the host connection layer is added to
pendingRequestsand only removed whennext()settles. The drain has no timeoutand does not distinguish one-shot requests from requests that outlive the update
flow. Any admitted request that stays open while the window is up (a streaming
response, a long-poll, a keep-alive request still being served) keeps its promise
pending forever, so
await Promise.all(pendingRequests)never resolves.The only bound on this is the shell side:
main.jscalls theupdate-taskscontrolrequest with a 10 s deadline, so the host never gets a chance to answer and the
user sees
desktop update: task inspection timed outinstead of a real task report.The same helper is used by the read-only
inspectaction, whose error text isidentical, so from the UI alone it is not obvious which of the two calls timed out —
but only
lockhas the unbounded drain shown above.Impact
The built-in updater is unusable on Desktop; the app can only be updated by quitting
it and replacing the
.appbundle manually. Since 0.2.2-rc.1 contains the exact samecode, upgrading does not fix this.
Suggested fix
Either of:
from
pendingRequests, tracking only requests an update would actually interrupt;or
hasDesktopActiveTasks()instead of failing the whole update.For diagnosis it would also help to log the URLs still admitted when the drain has
not settled after, say, 1 second — that immediately shows which connection is
blocking.
Workaround for other users
Quit the app, replace
/Applications/DeepSeek Harness.appwith the downloadedbundle, relaunch.
All reactions