mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 19:28:25 +00:00
The previous commit gated the share button on WorkoutOrigin, which closes only half the case. When a user shares a workout their watch recorded, TrainingLog.merge keeps the Health Connect copy and drops the published one, so the survivor is still WorkoutOrigin.HEALTH_CONNECT even though a kind 1301 for it is already out there — and the dashboard went on offering to share it. That is the likelier route to a duplicate, since sharing from Health Connect is the feature's main flow. Origin answers "where did this data come from", which is the wrong question. DetectedWorkout now also carries alreadyPublished, the merge hands it to the surviving copy, and the published-event mapper sets it too, so the dashboard has one field to read. Confirmed on device: a Health Connect ride shared from My Fitness keeps its metrics, does not duplicate, and loses its share button, while the six unshared sessions keep theirs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>