mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 21:10:59 +00:00
The Heart sync recorded only the device's atrial-fibrillation verdict per on-device ECG. Fetch each recording's full waveform via the Heart get endpoint and store the raw micro-volt samples so a real trace can later be rendered. The sample array is sensitive health data: it is held AES-256-GCM encrypted at rest in the new EcgRecording.waveformEncrypted Bytes column (fail-closed crypto), with the sampling frequency, sample count, duration, lead, average heart rate, and AFib verdict kept as plaintext descriptors. A re-sync upserts on (userId, source, externalRecordingId) so a recording is never duplicated; a waveform fetch failure never fails the verdict ingest. Rendering UI is a follow-up.