trails/docs/adr
Ullrich Schäfer 78b8b8f55f
Atomic GPX save: validate + persist row + geometry in one transaction
Eliminates the silent-failure pattern where a route/activity row could
be committed with gpx IS NOT NULL but geom IS NULL if the PostGIS write
failed after the row insert.

- New gpx-save.server.ts owns all GPX validation (GpxValidationError,
  validateGpx) and PostGIS geometry writes (writeGeom, tx-aware)
- createRoute, updateRoute, createActivity, createRouteFromActivity all
  wrapped in db.transaction() covering row + geom + version snapshot
- demo-bot uses createRoute/createActivity instead of raw inserts;
  errors propagate loudly
- Callback endpoint returns 400 for GpxValidationError instead of 401
- ADR-0006 documents the invariant for future explorers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 15:02:56 +02:00
..
0001-connected-services-credential-discriminator.md Add deepen-connected-services architecture artifacts 2026-05-08 01:14:38 +02:00
0002-no-unified-syncprovider-interface.md Add deepen-connected-services architecture artifacts 2026-05-08 01:14:38 +02:00
0003-routepusher-seam-shape.md Add deepen-connected-services architecture artifacts 2026-05-08 01:14:38 +02:00
0004-centralize-auth-completion.md Add unify-auth-completion architecture artifacts 2026-05-08 02:18:06 +02:00
0005-no-authmethod-polymorphism.md Add unify-auth-completion architecture artifacts 2026-05-08 02:18:06 +02:00
0006-atomic-gpx-save.md Atomic GPX save: validate + persist row + geometry in one transaction 2026-05-10 15:02:56 +02:00