Skip to content

Audit all data flows: eliminate default/empty values that cause downstream failures #70

Description

@STRRL

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

  1. InsertCompletedJob writes empty runner_name and runner_set_name — frontend crashes on undefined.split()
  2. RecordJobCompleted(jobID, result) doesn't pass through runnerName/runnerSetName even though the caller has them
  3. Job result stored in DB but toProtoJobResult() returns UNSPECIFIED (enum 0) for unrecognized values — protobuf omits the field — frontend defaults completed jobs to failure
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions