Cybersecurity-Projects/PROJECTS/beginner/canary-token-generator/frontend
CarterPerez-dev 44927b245c fix(canary): accept null events from manage response
Backend serializes `Events []Event` as JSON `null` when the slice is nil
(Go's zero value for slices). Spec §8.4 shows it as an array — stale spec,
verified actual behavior with `curl http://localhost:22784/api/m/<uuid>`
returning `"events": null` on a freshly-created token with no triggers.

Zod schema was `events: z.array(eventResponseSchema)` — failed to parse the
null, threw PARSE_ERROR, manage page rendered "CANNOT REACH ARCHIVE" instead
of the empty dossier.

Fixed: `.nullish().transform(v => v ?? [])` — accepts null/undefined and
normalizes to []. Manage page's `events.length === 0` empty-state check
("No events recorded yet") now reachable; consumers always see an array.

Caught by memory rule feedback_verify_data_shapes.md: trust reality > spec.
I trusted §8.4's example object during Phase 14 schema design instead of
hitting the live endpoint. Same kind of drift as the four Phase-14 spec-vs-code
divergences cleared at the time — this one slipped through because
TokenManagePage was never end-to-end exercised pre-UI.
2026-05-17 17:58:13 -04:00
..
public/asset feat(canary): import operator's React + Vite frontend template 2026-05-10 05:28:09 -04:00
src fix(canary): accept null events from manage response 2026-05-17 17:58:13 -04:00
.dockerignore feat(canary): import operator's React + Vite frontend template 2026-05-10 05:28:09 -04:00
.gitignore feat(canary): import operator's React + Vite frontend template 2026-05-10 05:28:09 -04:00
.stylelintignore fix(canary-phase1): clear all post-phase-1 audit observations + header normalization 2026-05-10 06:15:26 -04:00
biome.json feat(canary): import operator's React + Vite frontend template 2026-05-10 05:28:09 -04:00
index.html feat(canary): web fonts — Archivo Black / Space Grotesk / Departure Mono 2026-05-17 17:27:35 -04:00
package.json feat(canary): import operator's React + Vite frontend template 2026-05-10 05:28:09 -04:00
pnpm-lock.yaml feat(canary): import operator's React + Vite frontend template 2026-05-10 05:28:09 -04:00
stylelint.config.js fix(canary-phase1): clear all post-phase-1 audit observations + header normalization 2026-05-10 06:15:26 -04:00
tsconfig.app.json feat(canary): import operator's React + Vite frontend template 2026-05-10 05:28:09 -04:00
tsconfig.json feat(canary): import operator's React + Vite frontend template 2026-05-10 05:28:09 -04:00
tsconfig.node.json feat(canary): import operator's React + Vite frontend template 2026-05-10 05:28:09 -04:00
vite.config.ts fix(canary): vite dev proxy — correct backend port + stop stripping /api 2026-05-17 17:37:36 -04:00