react-native-health-connect icon indicating copy to clipboard operation
react-native-health-connect copied to clipboard

Sleep recordType value mismatch between methods

Open krisidmisso opened this issue 1 year ago • 3 comments

Describe the bug requestPermission() requires permission name as SleepSession and getGrantedPermissions() returns Sleep To Reproduce Steps to reproduce the behavior:

  1. Trigger requestPermission([{accessType: 'read', recordType: 'SleepSession'}])
  2. Trigger getGrantedPermissions()
  3. See permissions array from getGrantedPermissions

Expected behavior recordType should match on both methods

Screenshots image

Environment:

  • Health Connect Version: 1.2.3
  • React Native Version: 0.73.1
  • New architecture enabled: Yes

krisidmisso avatar Feb 01 '24 02:02 krisidmisso

It seems like this inconsistency comes from the health connect core. I will try to investigate this.

matinzd avatar Mar 19 '24 08:03 matinzd

Same for (at least): ExerciseSession --> Exercise HeartRateVariabilityRmssd -> HeartRateVariability MenstruationFlow -> Menstruation

... and probably few others that I don't use

RM-Smilamind avatar Jul 30 '24 09:07 RM-Smilamind

Hi any ETA on this? I'm happy to contribute if it's not picked or you're able to hand over.

ugurakin1 avatar Aug 12 '24 10:08 ugurakin1

Hey @matinzd, created a PR for a potential solution for this. If you could take a quick look whenever you can it would be grand, thanks in advance!

ugurakin1 avatar Aug 31 '24 13:08 ugurakin1

This should be fixed in v3.1.1.

matinzd avatar Sep 10 '24 21:09 matinzd