fix(phase26): BUG-10 side effect — preserve trips when OBD never connected

This commit is contained in:
Mathieu Moran
2026-08-11 03:56:00 -04:00
parent ae7f6358b2
commit cf096744d1
+5
View File
@@ -390,6 +390,11 @@ def refresh_trips(force=False):
(rebuild_start_id,),
).fetchall()
from modules import app_obd
if not app_obd.was_car_ever_connected():
# Never connected to the car — preserve existing trips, don't delete them.
return conn.execute("SELECT COUNT(*) FROM trips").fetchone()[0]
trips = app_trip.build_trip_summaries(rows)
with _conn_lock:
try: