fix: verify staged upgrades in the background before restarting

This commit is contained in:
whyour
2026-10-18 05:30:21 +08:00
parent a8d09a3c14
commit 2cd5e0b06c
4 changed files with 36 additions and 8 deletions
@@ -221,12 +221,14 @@ async function startJob({ root, tmp, env = process.env }, action) {
let selected;
let metadata;
if (action === 'apply') {
// Fail before launching a process or stopping the working panel.
// Keep requests short on slow devices. The detached worker performs
// complete file/dependency verification before it can stop the panel.
try {
selected = await artifacts.selectedUpgrade(
tmp,
artifacts.releaseBranch(env),
env,
{ metadataOnly: true },
);
metadata = await stagedMetadata(selected);
if (previous.status === 'ready')