mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 21:10:59 +00:00
The JSON import refused the app's own files: the full backup writes an empty note, tag list or glucose context as null and the JSON export as an empty string, and the import schema read either as a value of the wrong type. The file is now read in the exporter's terms before it is validated: the export's envelope is opened, every null or empty field is treated as absent, a backup row carrying a deletion is left out and counted as skipped, and a unit the app converts on every other way in is converted to the stored one. The round trip also showed the portable backup dropping what a reading itself says: glucose context, sleep stage, range bounds, rhythm and device. They ride the portable file now, and a portable restore puts them back. Sync bookkeeping stays out. An integration test exports an account three ways (full backup, JSON export, measurement CSV), imports each into a fresh account and compares what the import carries.