Skip to content

fix(workouts): recognize trail running and repair code 7 history - #71

Merged
lingcang728 merged 1 commit into
mainfrom
codex/fix-trail-running-cloud-code-7
Sep 10, 2026
Merged

fix(workouts): recognize trail running and repair code 7 history#71
lingcang728 merged 1 commit into
mainfrom
codex/fix-trail-running-cloud-code-7

Conversation

@lingcang728

Copy link
Copy Markdown
Owner

Fixes #24.

Zepp cloud-history code 7 was mapped using the Zepp OS device-protocol meaning, open_water_swimming. It now normalizes to trail_running, so the activity label and JSON, GPX and FIT exports reflect trail running automatically.

The evidence is visualcurrent's September 9 comment: the ZeppBridge screenshot shows raw code 7 and no correction; the matching Zepp screenshot identifies an Amazfit Balance trail run. The supplied JSON confirms numeric_mapped, and the official Zepp GPX identifies the same activity as Trail running. Both screenshots and the export snippets were checked. Tests reconstruct minimal cloud-shaped inputs from that evidence; the comment did not include a complete raw cloud response. No personal identifiers or GPS coordinates from the report are committed.

  • Update the shared catalog with the evidence link. Keep Open Water Swimming available for explicit names and manual corrections without inventing an unverified replacement cloud code; preserve pool-swimming code 14.
  • Add schema migration 22 to repair existing numeric_mapped code-7 swimming rows, including libraries whose raw payloads have expired. Only the stored interpretation changes; user overrides, metrics, routes and sync timestamps remain intact. Existing migration locking, transaction and pre-upgrade backup apply.
  • Advance the normalizer to v24. Upgrade from v23 replays workout summaries only; older upgrade paths still include their required streams.
  • Cover numeric/string code inputs, swimming non-regression, historical repair without raw data, replay/override preservation, English/Chinese labels, and JSON/GPX/FIT output (including decoding FIT sport/sub-sport as Running/Trail).

Validation: workspace Rust tests (389 passed, 1 pre-existing ignored), Clippy with warnings denied, rustfmt, frontend build/tests (110 passed), Functions tests (33 passed), version/docs/i18n checks and bundle budget. Also ran the compiled Windows CLI against an isolated on-disk v21 library with no raw payloads: verified migration, exact preservation of all other workout columns, routes, the original v21 backup, JSON/GPX/FIT exports and idempotent replay.

Reporter-device retesting remains for the eventual release. Existing export files must be exported again. This PR is ready for the maintainer to review and merge; no release is published here.

@lingcang728
lingcang728 merged commit 4bf2540 into main Sep 10, 2026
9 checks passed
@lingcang728
lingcang728 deleted the codex/fix-trail-running-cloud-code-7 branch September 10, 2026 09:29
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.

Trail Running activity shows as Open Water Swimming activity

1 participant