CourseModule constructor never assigns this.number — every module.number is undefined #809

Closed
opened 2026-07-23 04:33:41 +00:00 by spikerj · 1 comment
Owner

Bug (found via coverage wave 3, spikersoft-angular PR #551).

CourseModule (projects/spikersoft/src/app/_components/classes/module.ts) declares a constructor parameter number: number and a public number: number field, but the constructor body never runs this.number = number; — it only assigns activity_title, activity_type, lessons, title.

Result: every CourseModule instance has number === undefined, even though classes.ts passes 1..10 for both cp101 and dbs101. The parameter is dead and the public field is permanently undefined.

Currently latent (no reader of module.number found in the classes dir), so no visible breakage — but any UI/logic that later orders or labels modules by .number would silently get undefined.

Fix: add this.number = number; to the constructor.

Pinned as a characterization test in PR #551 (classes.spec.ts) asserting the current undefined behavior and referencing this ticket; flip those assertions to expect 1..10 when fixed.

**Bug (found via coverage wave 3, spikersoft-angular PR #551).** `CourseModule` (`projects/spikersoft/src/app/_components/classes/module.ts`) declares a constructor parameter `number: number` and a `public number: number` field, but the constructor body never runs `this.number = number;` — it only assigns `activity_title`, `activity_type`, `lessons`, `title`. Result: **every** `CourseModule` instance has `number === undefined`, even though `classes.ts` passes `1..10` for both `cp101` and `dbs101`. The parameter is dead and the public field is permanently undefined. Currently latent (no reader of `module.number` found in the classes dir), so no visible breakage — but any UI/logic that later orders or labels modules by `.number` would silently get `undefined`. **Fix:** add `this.number = number;` to the constructor. Pinned as a characterization test in PR #551 (`classes.spec.ts`) asserting the current `undefined` behavior and referencing this ticket; flip those assertions to expect `1..10` when fixed.
Author
Owner

Migrated to spikerj/spikersoft-angular#648 as part of the umbrella-tracker breakup.

Verified 2026-08-07 against spikersoft-angular@8e5a404.

  • Code: Unchanged. projects/spikersoft/src/app/_components/classes/module.ts:5-10 — the constructor takes number: number but its body assigns only activity_title, activity_type, lessons, title. public number: number; is declared at :12 and never assigned anywhere in the 16-line file.
  • Live: Nothing runtime-observable — still latent, no reader of module.number exists, so the permanently-undefined field produces no visible symptom yet.

Status: not done — The one-line fix (this.number = number;), plus flipping the characterization assertions in classes.spec.ts (added by spikersoft-angular PR #551) from undefined to 1..10.

Closing here. Work now lives in the repo that holds the fix, so fixes #648 in a PR will auto-close it on merge. The umbrella tracker keeps cross-repo epics only.

— Opus 5 Agent

Migrated to **spikerj/spikersoft-angular#648** as part of the umbrella-tracker breakup. Verified 2026-08-07 against `spikersoft-angular@8e5a404`. - **Code:** Unchanged. `projects/spikersoft/src/app/_components/classes/module.ts:5-10` — the constructor takes `number: number` but its body assigns only `activity_title`, `activity_type`, `lessons`, `title`. `public number: number;` is declared at `:12` and never assigned anywhere in the 16-line file. - **Live:** Nothing runtime-observable — still latent, no reader of `module.number` exists, so the permanently-`undefined` field produces no visible symptom yet. Status: **not done** — The one-line fix (`this.number = number;`), plus flipping the characterization assertions in `classes.spec.ts` (added by spikersoft-angular PR #551) from `undefined` to `1..10`. Closing here. Work now lives in the repo that holds the fix, so `fixes #648` in a PR will auto-close it on merge. The umbrella tracker keeps cross-repo epics only. — Opus 5 Agent
Sign in to join this conversation.