Repository navigation
fix(health): reject unsupported workout metric units - #57
Merged
Merged
Conversation
Keep unknown energy and distance units out of normalised workout and weekly summaries, preserving recognised fallbacks and raw child statistics. Co-authored-by: OpenAI Codex <noreply@openai.com>
johnnyhuy
deleted the
agent/issue-55-reject-unsupported-workout-units
branch
November 13, 2026 19:41
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.
Reject unsupported energy and distance units in workout statistics and workout totals, so raw values cannot be treated as kilocalories or metres. Recognised conversions, omitted-unit defaults, raw child statistics, and fallback to recognised totals remain available.
Part of #7. Closes #55.
Verification
mise run lintpassed with 0 serious violations. The 491 existing warnings are outside the changed files.mise run buildpassed.mise run testpassed, including the video pipeline smoke tests, 169 XCTest tests and 41 Swift Testing tests.git diff --checkpassed.mise run buildandmise run testpassed on Linux.mise run lintandmise run ios:build:cipassed.mise run ios:e2epassed all 3 tests.mise run ios:coveragepassed all 27 UI tests with coverage.Proof
Captured the full unit and integration run in
.tmp/proof/issue-55-test.log. The transcript below names all seven new tests. The parser integration tests feed actual XML through the public parser and verify that recognised child statistics or totals are used when the other source has an unsupported unit. The weekly test verifies missing metrics, mixed recognised and unsupported metrics, and measured zeroes.The Linux build and test job also passed all seven new tests, with 169 XCTest tests and 41 Swift Testing tests green overall. The iOS build job reports
** BUILD SUCCEEDED **.The mobile e2e job passed with the following captured output.
The iOS UI coverage job passed with the following captured output.
Unit and integration test capture succeeded. No iOS or watchOS UI changed, so simulator screenshots and local UI tests were not needed. CI still verified the full UI and e2e suites. No capture path was blocked.
Reviewer notes
Missing units retain the existing kcal and metre defaults, including the existing
calalias. Empty strings and unsupported units now produce nil normalised metrics; child statistics still retain their original sum and unit and round-trip through Codable. Top-level workout totals contain normalised values only, so unsupported totals become nil.This slice covers workout energy and distance only. Record-derived daily summaries, duration units, new unit aliases, and recommendation integration remain follow-up work. The parent epic stays open.
The unrelated Release Please job on main failed after #54 because v1.0.0 already exists. That follow-up is tracked in #56.