beeminder / BeeSwift

Official Beeminder for iOS app
Other
29 stars 5 forks source link

Only register with HealthKit for each goal once #333

Closed theospears closed 1 year ago

theospears commented 1 year ago

We have a tendency to repeatedly try to register each goal with HealthKit. This results in callbacks being called many times, and us and the server doing extra work. Here each GoalHealthKitConnection checks if it has registered and avoids doing so multiple times.

This could cause issues if a goal switched metric, but that state is already very broken in the app in terms of reporting.

Test Plan: Ran in debugger and observed log output