diff --git a/src/ui/linker.ts b/src/ui/linker.ts index 61689ce..3488f44 100644 --- a/src/ui/linker.ts +++ b/src/ui/linker.ts @@ -488,6 +488,9 @@ export class Linker { const res = await post("jobs", { scope, doc, review: this.effective() === "review" }); const r = await res.json().catch(() => ({})); if (!res.ok) return r.error ?? `the server answered ${res.status}`; + // A short job's end can be announced before this answer arrives: keep the later news. + const had = this.job; + if (had && had.id === r.job.id && had.state !== "running") return had; this.job = r.job; return r.job; } diff --git a/src/ui/store.ts b/src/ui/store.ts index 293e19b..0747f32 100644 --- a/src/ui/store.ts +++ b/src/ui/store.ts @@ -3105,7 +3105,8 @@ class Store { async linkJob(scope: "doc" | "library", doc?: NodeId, quiet = false) { const r = await this.links.startJob(scope, doc); if (typeof r === "string") return this.say(`Could not start looking for links: ${r}`); - if (!quiet || r.slow) this.say(this.jobText(r)); + // Already over (a short job announced its end first): that has been said. + if (r.state === "running" && (!quiet || r.slow)) this.say(this.jobText(r)); } async cancelLinkJob() {