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
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