marks-address: duplicate @for track keys for unsaved addresses + saveAddresses() is a stub #760

Open
opened 2026-07-21 02:59:53 +00:00 by spikerj · 1 comment
Owner

Two pre-existing issues noticed while converting marks-site off ngModel (epic #722 wave-2 batch 7, PR spikersoft-angular#492 — neither introduced there):

  1. Duplicate track keys: the address list iterates @for (entry of ... ; track entry.addressId) and newCustomerAddress() creates entries with addressId: "". Add a second address before saving the first → two entries share the "" key → Angular duplicate-track-key runtime error (NG0955 class) and broken row identity. Track by $index or mint a temp id.

  2. saveAddresses() is a console.warn/console.log stub — the Addresses tab has no persistence path at all (only verifyAddress() touches the service, and only for addresses[0]). Related smell in the same area: marks-service-contract renders a large hard-coded demo contracts array, and day-scheduler declares public hours: ["12:00am", ...] as a type annotation with no initializer (the property is undefined at runtime and unused).

Worth deciding whether marks-site's address/contract tabs are demo scaffolding to finish or to prune.

Two pre-existing issues noticed while converting marks-site off ngModel (epic #722 wave-2 batch 7, PR spikersoft-angular#492 — neither introduced there): 1. **Duplicate track keys:** the address list iterates `@for (entry of ... ; track entry.addressId)` and `newCustomerAddress()` creates entries with `addressId: ""`. Add a second address before saving the first → two entries share the `""` key → Angular duplicate-track-key runtime error (NG0955 class) and broken row identity. Track by `$index` or mint a temp id. 2. **`saveAddresses()` is a `console.warn`/`console.log` stub** — the Addresses tab has no persistence path at all (only `verifyAddress()` touches the service, and only for `addresses[0]`). Related smell in the same area: `marks-service-contract` renders a large hard-coded demo `contracts` array, and `day-scheduler` declares `public hours: ["12:00am", ...]` as a *type annotation with no initializer* (the property is `undefined` at runtime and unused). Worth deciding whether marks-site's address/contract tabs are demo scaffolding to finish or to prune.
Author
Owner

Board-sweep verification (2026-07-22): still live — marks-address.component.html line 30 still tracks @for by entry.addressId, which is exactly the reported duplicate-key collision for unsaved addresses (no id yet). No fix commit references this file.

Board-sweep verification (2026-07-22): still live — marks-address.component.html line 30 still tracks @for by entry.addressId, which is exactly the reported duplicate-key collision for unsaved addresses (no id yet). No fix commit references this file.
Sign in to join this conversation.