Reflect watch-forwarded workout progress on the phone immediately

ingestFromWatch now upserts the SwiftData cache directly after writing the file,
instead of relying on the NSMetadataQuery observer — a same-process file
overwrite doesn't reliably emit a modified event, so watch progress never reached
open iPhone screens. iCloud Drive stays the source of truth (file written first);
the observer re-applies idempotently if it fires.

Claude-Session: https://claude.ai/code/session_018gg69MaUetDNzWzBXisfMV
This commit is contained in:
2026-06-19 17:17:14 -04:00
parent 8c6e798aba
commit 180f07e23c
2 changed files with 16 additions and 2 deletions
+4
View File
@@ -16,6 +16,10 @@ All notable changes to this project are documented here.
advances the set count on the iPhone and a finished set is never un-counted, and
reopening an exercise jumps straight to the first unfinished set (skipping
completed work/rest pairs) instead of snapping back to set 1.
- Fixed: progress made on the watch now updates open iPhone screens live. The
phone applies a watch-forwarded workout to its cache directly on receipt, instead
of waiting on an `NSMetadataQuery` event that a same-process file overwrite
doesn't reliably emit.
- Starting a workout on the iPhone now launches the Apple Watch app straight into
the session via HealthKit (a one-time Health permission); the watch holds an
`HKWorkoutSession` to stay active while you train and releases it when the