Skip to content

fix(import): convert Apple Health weights per record - #432

Merged
DuarteSantos8 merged 2 commits into
DuarteSantos8:mainfrom
ac1982:fix/apple-health-record-units
Oct 9, 2026
Merged

DuarteSantos8 merged 2 commits into
DuarteSantos8:mainfrom
ac1982:fix/apple-health-record-units

Conversation

@ac1982

@ac1982 ac1982 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

An Apple Health export containing an 80 kg record followed by a 180 lb record imports as 36.3 kg and 81.6 kg into a kg profile. The parser applies the last record's unit to the entire file; reversing the records changes the imported values.

Keep each XML record's unit until conversion, so the same export imports as 80 kg and 81.6 kg (or 176.4 lb and 180 lb). The existing import preview names both source units for a mixed file. Single-unit XML and CSV conversion remain covered.

Validation: three new regression cases fail on main and pass with the fix; all 30 tests across import-bodyweight, import-csv, import-effort, and sheets.import-summary pass. npm run build passes. Chromium verification uploaded a mixed-unit XML through Settings, confirmed the import, and checked that 80 and 81.6 remained stored after a reload, with no page errors.

Checked existing issues and PRs for Apple Health, bodyweight, and mixed units. #350 fixes malformed/zero Apple Health values in this parser; this change addresses unit conversion independently. AI-assisted contribution.

crstnmac added a commit to crstnmac/openGym that referenced this pull request Oct 9, 2026
@DuarteSantos8
DuarteSantos8 merged commit 28ec0b6 into DuarteSantos8:main Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants