Repository navigation
fix(import): convert Apple Health weights per record - #432
Merged
DuarteSantos8 merged 2 commits intoOct 9, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 buildpasses. 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.