mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-19 00:12:18 +00:00
A backup written before migration 0420 files Fitbit and Google Health HRV as HEART_RATE_VARIABILITY, and the restore wrote it back verbatim, undoing the migration for the account (and able to duplicate an HRV_RMSSD row of the same night, since type is part of the unique key). The restore now applies the same move: those rows come back as HRV_RMSSD, a legacy row whose RMSSD twin the file also holds is skipped, and SDNN personal records set by them are left out as the migration deleted them.
21 lines
547 B
TypeScript
21 lines
547 B
TypeScript
/** The sources whose HRV migration 0420 refiled from SDNN to RMSSD. */
|
|
export const LEGACY_RMSSD_SOURCES: ReadonlySet<string> = new Set([
|
|
"FITBIT",
|
|
"GOOGLE_HEALTH",
|
|
]);
|
|
|
|
/**
|
|
* A Fitbit or Google Health HRV row a file written before migration 0420
|
|
* still files as `HEART_RATE_VARIABILITY` (SDNN). It is RMSSD.
|
|
*/
|
|
export function isLegacyRmssdRow(row: {
|
|
type: string;
|
|
source?: string | null;
|
|
}): boolean {
|
|
return (
|
|
row.type === "HEART_RATE_VARIABILITY" &&
|
|
row.source != null &&
|
|
LEGACY_RMSSD_SOURCES.has(row.source)
|
|
);
|
|
}
|