fix: reconcile stale staged updates
TallyNote release / linux-x64 (push) Successful in 6m50s

This commit is contained in:
Qiufeng
2026-09-05 16:31:53 +08:00
parent efbd0e0d87
commit 6c96cddd4e
4 changed files with 20 additions and 5 deletions
+13 -1
View File
@@ -451,7 +451,19 @@ export default function UpdatePage({
setError("");
try {
const result = await api<UpdateInfo>("/api/update/check", { method: "POST" });
mergeInfo(result, true);
// A check response is authoritative for release availability. It does
// not include a job field, so retain a task only while it is still
// actionable; the status endpoint has already reconciled expired
// staged tasks before this check runs.
setLiveInfo((current) => ({
...(current ?? result),
...result,
job: current?.job && (
current.job.status === "completed" ||
(current.job.status !== "staged" || current.job.operation !== "download") ||
(result.latest?.isNewer === true && result.latest.version === current.job.version)
) ? current.job : null,
}));
notify?.("版本检查完成", "info");
} catch (e) {
if (e instanceof ApiError && e.status === 429) {