Series autopilot "skips when disabled" test passes through the crash catch-all, not the skip guard

Chiusa Adatta ai principianti
#11,999 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
83/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
testing

Direzione di ricerca

Leggi i casi in server/services/seriesAutopilotScheduler.test.js intorno alle righe 184–201 e il controllo di protezione in server/services/seriesAutopilotScheduler.js intorno alle righe 113–116. Aggiorna entrambi i casi di esclusione in modo che verifichino il log di esclusione appropriato e confermino che console.error non venga chiamato. Esegui il file di test dello scheduler e verifica che il caso disabilitato fallisca quando viene rimosso il controllo di protezione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

effort:low model:light plan planner:fable-5-1 test-quality tests

Slice audited: scheduled-work tests (test-quality audit, 2026-10-18).

Problem

server/services/seriesAutopilotScheduler.test.js:184-189 ("skips when the schedule was disabled since registration") asserts only expect(startSeriesAutopilot).not.toHaveBeenCalled(). The guard it names is server/services/seriesAutopilotScheduler.js:113-116 (if (!entry) { log; return; }).

Mutation probe (scratch worktree): deleted the four-line if (!entry) block.

Tests  18 passed (18)

Execution falls through to runOptionsFor(undefined), which throws TypeError on entry.provider; the timer callback's outer try/catch logs a ❌ … failed line and returns, so the negative spy is satisfied by the crash rather than the skip. The sibling case at :201 ("skips when the series no longer exists") has the same shape.

Impact

A scheduled multi-stage series-autopilot LLM run (provider spend) can fire while the user has it disabled if a refactor makes runOptionsFor null-tolerant and drops or moves the guard; the only signal would be a log line, and the suite stays green.

Fix (decided)

In both cases, spy on console.log and console.error, assert the disabled/removed since registration — skipping run (or no longer exists) line was logged, and assert console.error was not called. No production code change (returning a { skipped } value is acceptable if preferred, but not required).

Scope: small

Acceptance criteria

  • Deleting the if (!entry) block fails the "disabled since registration" case.
  • Both skip cases assert the skip log line and the absence of an error log.
  • No production code change required.
Lingua principale
JavaScript
Stelle
38
Fork
32
Merge medio
40m
PR unite (30g)
992

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.