A short link job whose end is announced before its start is answered stays ended

The page took the start's answer (running) over the end it had already heard, and
then waited for a job that was over; it also said the job was running after
saying it had finished.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
This commit is contained in:
thalladaandClaude Opus 5.5 committed 2026-11-16 16:54:31 -05:00
1 parent 28185a9fad
commit 8a54833680
2 files changed
+5 -1

No files matched your search

+3
View File
@@ -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;
}
+2 -1
View File
@@ -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() {