From c080e7054d01dec5d3889fb8813e9149be1c2789 Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Thu, 15 Jan 2026 14:14:42 +0000 Subject: [PATCH] Add debug logging for body battery API response Need to inspect the raw response structure to debug why current and yesterdayLow values are missing despite hasCurrentData=true. Co-Authored-By: Claude Opus 4.5 --- src/lib/garmin.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/garmin.ts b/src/lib/garmin.ts index df4fa4e..2e3329b 100644 --- a/src/lib/garmin.ts +++ b/src/lib/garmin.ts @@ -142,6 +142,12 @@ export async function fetchBodyBattery( bodyBatteryValuesArray?: Array<[number, string, number, number]>; }>; + // Debug: log the raw response structure + logger.info( + { rawData: JSON.stringify(data).slice(0, 2000), date, yesterday }, + "Body battery raw API response", + ); + // Find today's and yesterday's data from the response array const todayData = data?.find((d) => d.date === date); const yesterdayData = data?.find((d) => d.date === yesterday);