You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sims-hq/apps/hq
Thomas Joise 04aef0aa36 fix(api): validate ?days= and guard the onboarding-project routes against a crash (FIX B)
GET /projects/stalled had no try/catch, and a caller-supplied ?days= flowed
straight into `new Date(...).toISOString()`. Confirmed the exact crash:
Number('1e300') passes Number.isFinite (so the old guard let it through),
but the resulting cutoff math overflows the valid Date range and
.toISOString() throws RangeError. Uncaught in an async Express handler this
is an unhandled rejection, which kills the whole process on Node 22 -- any
authenticated role, including plain staff, could take the console down with
one GET.

`days` is now validated (integer, 0-3650) with an explicit 4xx on anything
hostile, falling back to the configured default only when the param is
absent (matches the frontend, which never sends ?days= at all). Audited
every other route this feature added to the same section: /projects/board
and /projects/pending/:key had the identical no-try/catch shape and are now
wrapped too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 day ago
..
scripts fix(deploy): one shared DB-engine resolver so scripts can't silently target a throwaway SQLite file (FIX A) 1 day ago
src fix(api): validate ?days= and guard the onboarding-project routes against a crash (FIX B) 1 day ago
test fix(api): validate ?days= and guard the onboarding-project routes against a crash (FIX B) 1 day ago
.env.example feat(d32): remove the key concept entirely + keyless legacy cleanup 3 days ago
build-server.mjs feat(hq): server assembly, build script and e2e smoke (HQ-1 task 14) 2 weeks ago
package.json feat(d20): P4 — full-APEX importer v2 (9 files, stage/commit, CLI) 4 days ago
schema.sql docs+chore: HQ DDL snapshot, gitignored import-drop, Postgres locked pre-go-live (D15) 2 weeks ago
tsconfig.json feat(hq): app skeleton with health endpoint (HQ-1 task 1) 2 weeks ago