Deploy Defender: pipelineHealth HUD sticks at first value (stages not a signal) #1008

Closed
opened 2026-08-12 06:40:36 +00:00 by spikerj · 1 comment
Owner

Summary

DeployDefenderComponent.pipelineHealth is an Angular computed() that reads the plain stages: PipelineStage[] array (mutated in place during gameplay). Because the computed has no signal dependencies, it evaluates once and never re-runs when stage health changes.

Impact

  • HUD pipeline health bar stays at the first-evaluated value (typically 100%) for the whole session after first read.
  • Wave-complete health bonus (pipelineHealth() * wave) can use a stale value if the computed was primed earlier in the session.

Repro (unit)

Covered by deploy-defender.gameplay.spec.ts — "pipelineHealth computed sticks after first read".

Suggested fix

Track stage health via a signal (e.g. stages = signal<PipelineStage[]>([])) or invalidate a version signal whenever health changes, and read that from pipelineHealth.

## Summary `DeployDefenderComponent.pipelineHealth` is an Angular `computed()` that reads the plain `stages: PipelineStage[]` array (mutated in place during gameplay). Because the computed has **no signal dependencies**, it evaluates once and never re-runs when stage health changes. ## Impact - HUD pipeline health bar stays at the first-evaluated value (typically 100%) for the whole session after first read. - Wave-complete health bonus (`pipelineHealth() * wave`) can use a stale value if the computed was primed earlier in the session. ## Repro (unit) Covered by `deploy-defender.gameplay.spec.ts` — "pipelineHealth computed sticks after first read". ## Suggested fix Track stage health via a signal (e.g. `stages = signal<PipelineStage[]>([])`) or invalidate a version signal whenever health changes, and read that from `pipelineHealth`.
Author
Owner

Already on master (not part of PR #819). Deploy Defender pipelineHealth already reads a stagesVersion signal, so the HUD recomputes as stages take damage. Closing.

Already on `master` (not part of PR #819). Deploy Defender pipelineHealth already reads a stagesVersion signal, so the HUD recomputes as stages take damage. Closing.
Sign in to join this conversation.