space-game PeriodicTableHUD: render() catch leaves autoClear=false #1086

Closed
opened 2026-08-13 13:54:49 +00:00 by spikerj · 1 comment
Owner

Wave 8 coverage a3 (PeriodicTableHUD.render in projects/spikersoft/src/app/_components/_games/space-game/hud/periodic-table-hud.ts).

The overlay path sets renderer.autoClear = false, then clearDepth() + render(). The previous autoClear is restored only on the success path. If renderer.render throws, the catch logs and returns without restoring, so the game renderer keeps autoClear = false for subsequent frames.

Repro (unit, jsdom, stub WebGLRenderer — no GPU):

  1. show().
  2. render({ autoClear: true, clearDepth, render: () => { throw new Error("fake gpu"); } }).

Observed: render() does not throw (error is logged as [PeriodicTableHUD] Render error:), but renderer.autoClear is left false.

Expected: restore autoClear in a finally (same pattern as other HUD overlays that already test this).

Covered by periodic-table-hud.leftovers.spec.ts (“render swallows WebGL errors but leaves autoClear=false”).

Wave 8 coverage a3 (`PeriodicTableHUD.render` in `projects/spikersoft/src/app/_components/_games/space-game/hud/periodic-table-hud.ts`). The overlay path sets `renderer.autoClear = false`, then `clearDepth()` + `render()`. The previous `autoClear` is restored only on the success path. If `renderer.render` throws, the `catch` logs and returns without restoring, so the game renderer keeps `autoClear = false` for subsequent frames. Repro (unit, jsdom, stub WebGLRenderer — no GPU): 1. `show()`. 2. `render({ autoClear: true, clearDepth, render: () => { throw new Error("fake gpu"); } })`. Observed: `render()` does not throw (error is logged as `[PeriodicTableHUD] Render error:`), but `renderer.autoClear` is left `false`. Expected: restore `autoClear` in a `finally` (same pattern as other HUD overlays that already test this). Covered by `periodic-table-hud.leftovers.spec.ts` (“render swallows WebGL errors but leaves autoClear=false”).
Author
Owner

Fixed in spikersoft-angular PR #823 (a0f0ccd9). Closing.

Fixed in `spikersoft-angular` [PR #823](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/823) (`a0f0ccd9`). Closing.
Sign in to join this conversation.