fix: BUG-06 — convert naive Pi timestamps to TZ-aware before upload so Postgres TIMESTAMPTZ stores correct instant

This commit is contained in:
Mathieu Moran
2026-08-11 14:47:37 -04:00
parent 9733036510
commit 7ce2a1e5f5
3 changed files with 39 additions and 9 deletions
+8 -2
View File
@@ -1860,7 +1860,7 @@ phase roadmap.
---
### Phase 26: Road-test bug fixes — 🚧 IN PROGRESS (7 closed, 1 open, 1 hardware)
### Phase 26: Road-test bug fixes — 🚧 IN PROGRESS (7 closed, 1 deployed awaiting test, 1 open, 1 hardware)
**Last updated 2026-08-11.** Targeted bug-fix pass for defects surfaced by the Phase 25 in-car
road test. Each item tracked in [BUGS.md](./BUGS.md).
@@ -1890,11 +1890,17 @@ rather than incremental patching:
- **Same JS file works on both Pi and server**: tile URL/attrib/zoom defaults read from
`data-*` attributes on `#history-map`, with Pi-local fallbacks when absent.
**Deployed, awaiting new-data verification:**
- BUG-06: `_to_tz_aware()` helper in `app_upload.py` converts naive SQLite datetimes
to TZ-aware ISO strings (e.g., `2026-08-10T19:27:30-04:00`) before upload. Postgres
`TIMESTAMPTZ` now stores the correct instant. Existing server rows NOT migrated —
only new uploads benefit until a one-time UPDATE is run.
**Deployed and verified on both platforms (2026-08-11):**
- BUG-01: Dual-radio setup — wlan0 is permanent AP at 10.42.0.1, wlan1 handles internet uplink only. `yaris_uplink.py` no longer touches the AP. In-car access card on Settings page shows hotspot URL + cell-data warning. Netwatch fixed to not tear down AP when clients connected (backup, not needed with dual-radio).
- BUG-07 history.js rewrite (see above) — rapid trip-switching no longer freezes, loading spinner + active row highlight provide clear feedback. Verified on Pi and server.
**Still open:** BUG-06 (timezone shift).
**Still open:** None.
BUG-02 is hardware (Pi micro-USB port damage) — owner's responsibility.
**Acceptance:** every `BUGS.md` entry in scope is fixed, regression-tested, deployed, and marked resolved.