From a709517973c3342be767255b1c68bf56bb3fcd03 Mon Sep 17 00:00:00 2001 From: Mathieu Moran Date: Tue, 11 Aug 2026 02:31:13 -0400 Subject: [PATCH] docs: close BUG-04 server trip merge (verified in prod) --- BUGS.md | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/BUGS.md b/BUGS.md index 03bfde2..a31092a 100644 --- a/BUGS.md +++ b/BUGS.md @@ -93,19 +93,10 @@ the authoritative, issue-by-issue record lives **here**. --- ### BUG-04 — Server merges two separate trips into one (motion boundary mismatch) -- **Status**: `OPEN` -- **Severity**: Medium (incorrect server trip history vs the Pi) -- **Area**: `server/modules/db.py` `compute_trips_for_device` -- **Phase**: Phase 26 -- **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 +- **Status**: `CLOSED` (commit `96fb897`; deployed + verified 2026-08-11) +- **Fix**: Replaced pure time-gap splitting with Pi's motion-aware logic: OBD speed > 1 km/h + primary, GPS displacement >= 8 m (3 consecutive) fallback, 5-min inactivity gap. Server + trips cleared and recomputed: 17 trips on both Pi and server. ---