Files
WerkoutIOS/docs/step10_reliability_round2.md

1.5 KiB

Step 10 Reliability Round 2

Coverage

  • Reviewed and patched:
    • iphone/Werkout_ios/BridgeModule+Watch.swift
    • iphone/Werkout_ios/BridgeModule+WorkoutActions.swift
    • iphone/Werkout_ios/CurrentWorkoutInfo.swift
    • iphone/Werkout_watch Watch App/WatchDelegate.swift
    • iphone/Werkout_ios/UserStore.swift
  • Validation:
    • ./scripts/smoke/smoke_all.sh
    • iOS/tvOS analyzer passes

Fixes

  1. Main-thread state safety for watch session callbacks

    • Wrapped didReceiveMessageData action handling and activationDidCompleteWith state transitions on main.
    • Prevents shared bridge state (@Published workout/watch properties + queued message mutations) from being changed off-main.
  2. Removed dead closure path that could retain BridgeModule

    • Removed unused CurrentWorkoutInfo.complete closure and its assignment in BridgeModule+WorkoutActions.start(workout:).
    • Reduces lifecycle risk and removes dead behavior.
  3. HealthKit authorization crash hardening on watch launch

    • Replaced force-unwrapped quantity types with guarded optional binding in WatchDelegate.
    • Logs and exits cleanly if required HealthKit quantity types are unavailable.
  4. Cross-target notification compile stability

    • Updated UserStore.logout to post Notification.Name("CreatedNewWorkout") directly.
    • Avoids reliance on an iOS-only extension file when UserStore is compiled in tvOS target.

Validation

  • Smoke suite passed:
    • token scan
    • SharedCore tests
    • iOS/watchOS/tvOS builds