Add debug logging for body battery API response
All checks were successful
Deploy / deploy (push) Successful in 2m28s

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 <noreply@anthropic.com>
This commit is contained in:
2026-01-15 14:14:42 +00:00
parent 83fd29b6c6
commit c080e7054d

View File

@@ -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);