trails/apps/journal/app
Ullrich Schäfer 5643ce257a fix(journal): match metric route label against known templates
Follow-up to the route-label cardinality fix. The first cut collapsed
dynamic segments via regex (:id/:username/:provider) and capped the
distinct-route set at 200 with a /other overflow. In production that cap
filled almost entirely with vulnerability-scanner junk (`/.ssh/id_rsa`,
`/%00.aws/credentials`, …) on a first-come-first-served basis: only 3 real
templates made it in before the cap saturated, so legitimate routes hit
afterward were misbucketed into /other — the metric became useless for
per-route latency even though memory was bounded.

Replace the regex+cap approach with explicit matching against the journal's
known route templates (mirroring app/routes.ts). A `:param` segment matches
any single path segment; literals are preferred over params (so /routes/new
beats /routes/:id); anything matching no template collapses to /other
immediately — no per-path tracking, no cap race. Cardinality is hard-bounded
to (templates + 1) regardless of traffic, and scanner noise can never crowd
out real routes.

A co-located drift guard flattens the real route config and fails if
ROUTE_TEMPLATES and app/routes.ts ever diverge.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 11:00:03 +02:00
..
components route-surface-breakdown (Phase 1): Planner-path surface/waytype bars 2026-06-14 18:46:49 +02:00
hooks route-surface-breakdown (Phase 2): async Overpass backfill + SSE 2026-06-14 19:18:03 +02:00
jobs route-surface-breakdown (Phase 2): async Overpass backfill + SSE 2026-06-14 19:18:03 +02:00
lib fix(journal): match metric route label against known templates 2026-06-19 11:00:03 +02:00
routes route-surface-breakdown (Phase 2): async Overpass backfill + SSE 2026-06-14 19:18:03 +02:00
entry.client.tsx Add legal pages, ToS acceptance, and alpha banner 2026-04-18 00:08:48 +02:00
entry.server.tsx Consolidate Sentry config into shared package; fix inconsistencies 2026-04-18 00:30:09 +02:00
root.tsx remove the map and ui shim packages 2026-06-10 07:47:59 +02:00
routes.ts feat(journal): Garmin activity import — provider, webhook pipeline, backfill (§1–5) 2026-06-07 17:47:22 +02:00
styles.css remove the map and ui shim packages 2026-06-10 07:47:59 +02:00