fix(consult): a warm that cannot be scheduled no longer fails the save (BUG-1305)
Independent Staging Quality Gate / validate (push) Successful in 13m12s
Independent Staging Quality Gate / publish (push) Successful in 4m16s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
This commit is contained in:
Jesse_Chen
2026-10-09 15:17:00 +08:00
co-authored by Claude Opus 5.5
parent cd625e8a35
commit b4eedb7725
5 changed files with 48 additions and 8 deletions
@@ -33,3 +33,19 @@ test("a saved chart becomes a warm request and the caller does not wait", () =>
assert.equal(started, true);
assert.equal(finished, false);
});
test("a warm that cannot be scheduled does not break the save (BUG-1305)", () => {
// Default deps use Next `after`, which throws outside a request scope.
assert.equal(scheduleConsultPacketWarm(columns), false);
let fetched = false;
const scheduled = scheduleConsultPacketWarm(columns, {
after: () => { throw new Error("outside a request scope"); },
fetch: () => {
fetched = true;
return Promise.resolve(new Response(null));
},
apiBase: "http://127.0.0.1:9",
});
assert.equal(scheduled, false);
assert.equal(fetched, false);
});