docs: close BUG-04 server trip merge (verified in prod)

This commit is contained in:
Mathieu Moran
2026-08-11 02:31:13 -04:00
parent 96fb8971eb
commit a709517973
+4 -13
View File
@@ -93,19 +93,10 @@ the authoritative, issue-by-issue record lives **here**.
--- ---
### BUG-04 — Server merges two separate trips into one (motion boundary mismatch) ### BUG-04 — Server merges two separate trips into one (motion boundary mismatch)
- **Status**: `OPEN` - **Status**: `CLOSED` (commit `96fb897`; deployed + verified 2026-08-11)
- **Severity**: Medium (incorrect server trip history vs the Pi) - **Fix**: Replaced pure time-gap splitting with Pi's motion-aware logic: OBD speed > 1 km/h
- **Area**: `server/modules/db.py` `compute_trips_for_device` primary, GPS displacement >= 8 m (3 consecutive) fallback, 5-min inactivity gap. Server
- **Phase**: Phase 26 trips cleared and recomputed: 17 trips on both Pi and server.
- **Symptom**: Two distinct drives (parked in between) appear as a single merged trip on the remote
portal, while the Pi correctly reports them as separate trips.
- **Root cause**: The Pi splits trips by **motion** (OBD wheel speed + sustained GPS displacement,
with a 5-min motion gap). The server splits only by a **pure time gap** (>5 min) and filters by
duration/50 m, so parked idle tracking rows bridging two drives get combined into one trip.
- **Fix scope / actions**: Mirror the Pi's motion-aware trip-boundary logic on the server so the
two systems agree. Note this may re-split/recompute existing server trips — get owner sign-off
before recomputing, and re-run `scripts/recompute_trips.py` after the fix.
- **Acceptance**: A real drive with a parked gap produces the same number of trips on the server
--- ---