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

[Enhancement] Metadata typing

Open ugurakin1 opened this issue 1 year ago • 1 comments

Health Connect docs indicate for ExerciseSessionRecords, metadata field is @NonNull but we type metadata to optional for every record (code):

export interface BaseRecord {
  metadata?: Metadata;
}

Do we do this because some record types don't include metadata? Is there a way we can correct it?

ugurakin1 avatar Aug 18 '24 20:08 ugurakin1

Because I am using the base record both for inserting and result data that it is optional by default. When you are trying to insert a record metadata is optional but after the data insertion the metadata field will be populated. I need to use a separate base interface for results and inserts.

You can fix it and open a pull request if you want have some time.

matinzd avatar Aug 19 '24 07:08 matinzd