Description
Multiple dashboard bugs (#68, #69) stem from the same root pattern: data fields are left empty/default at write time, then downstream code assumes they will be populated, leading to incorrect display or crashes.
Known instances
InsertCompletedJob writes empty runner_name and runner_set_name — frontend crashes on undefined.split()
RecordJobCompleted(jobID, result) doesn't pass through runnerName/runnerSetName even though the caller has them
- Job result stored in DB but
toProtoJobResult() returns UNSPECIFIED (enum 0) for unrecognized values — protobuf omits the field — frontend defaults completed jobs to failure
- Frontend
fetchRecentJobs fallback: j.completedAt ? 'failure' : 'running' — any unknown result on a completed job becomes failure
What needs to happen
- Audit every write path (job start, job complete, runner state transitions) — ensure all required fields are populated at the point of write, not left for downstream to guess
- Audit every read/display path — ensure no code assumes a field is always present without a guard
- Specifically trace the full lifecycle: Scale Set API event → controller → JobStore → API server (protobuf) → frontend fetcher → UI component
- For each field (
runnerName, runnerSetName, result, startedAt, completedAt), verify it is correctly set at every stage
- Eliminate patterns where a field is "expected but empty" — either make it required and always populated, or make it explicitly optional and handle the missing case everywhere
Related issues
Description
Multiple dashboard bugs (#68, #69) stem from the same root pattern: data fields are left empty/default at write time, then downstream code assumes they will be populated, leading to incorrect display or crashes.
Known instances
InsertCompletedJobwrites emptyrunner_nameandrunner_set_name— frontend crashes onundefined.split()RecordJobCompleted(jobID, result)doesn't pass throughrunnerName/runnerSetNameeven though the caller has themtoProtoJobResult()returnsUNSPECIFIED(enum 0) for unrecognized values — protobuf omits the field — frontend defaults completed jobs tofailurefetchRecentJobsfallback:j.completedAt ? 'failure' : 'running'— any unknown result on a completed job becomesfailureWhat needs to happen
runnerName,runnerSetName,result,startedAt,completedAt), verify it is correctly set at every stageRelated issues