CraftHealth.requestAuthorization maps type names to HKObjectTypes with a switch that ends:
default:
breakAn unrecognised name is dropped without a word. With readOnly: true the share set is cleared as well, so an app whose types are all unrecognised calls healthStore.requestAuthorization(toShare: [], read: []) — which succeeds without showing a sheet, and every later query then fails with errorAuthorizationNotDetermined.
The types it knows: steps, heartRate, activeEnergy, distance, workouts, restingHeartRate, heartRateVariability, bodyMass, sleep.
Missing: the dietary ones. stacksjs/hq.training has just shipped a food log that asks for dietaryEnergy, dietaryProtein, dietaryCarbohydrates and dietaryFat. HealthKit has all four — .dietaryEnergyConsumed, .dietaryProtein, .dietaryCarbohydrates, .dietaryFatTotal — but Craft has no cases for them, so the feature reads nothing and says nothing about why.
Two things worth doing, and the second matters more than the first:
- Add the dietary quantity types, for read and for write — a food log wants to write what the person logged, not only read what other apps wrote.
- Stop dropping unknown types in silence.
default: breakturns a typo or a version skew into a feature that quietly does nothing. Returning an error naming the unrecognised type, or at minimum anNSLog, would have made this a five-minute problem instead of a feature that appears to work.
The same silence applies to any app ahead of Craft's type list, which is the normal case while both are moving.