Skip to content

Fix a minor issue on HealthKit library#17

Merged
tetujin merged 1 commit intomasterfrom
feature/healthkit-added-duration-obtain-func
Feb 17, 2026
Merged

Fix a minor issue on HealthKit library#17
tetujin merged 1 commit intomasterfrom
feature/healthkit-added-duration-obtain-func

Conversation

@tetujin
Copy link
Owner

@tetujin tetujin commented Feb 17, 2026

No description provided.

@tetujin tetujin requested a review from Copilot February 17, 2026 06:45
@tetujin tetujin merged commit 7cd5402 into master Feb 17, 2026
5 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the HealthKit plugin to persist the sensor label into recorded sample payloads (instead of always emitting an empty string), and introduces a helper API to update last-fetch timestamps for a provided set of HealthKit types.

Changes:

  • Populate label in saved HealthKit quantity and category records when available.
  • Add setLastFetchTime:withHKDataTypes: to set per-type last record timestamps for a provided set of HK types.
  • Bump podspec version to 1.14.19.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
AWAREFramework/Classes/Plugins/HealthKit/AWAREHealthKitQuantity.m Writes label into quantity sample dictionaries when non-nil.
AWAREFramework/Classes/Plugins/HealthKit/AWAREHealthKitCategory.m Writes label into category sample dictionaries when non-nil.
AWAREFramework/Classes/Plugins/HealthKit/AWAREHealthKit.m Adds helper to set last fetch time for a set of HealthKit types.
AWAREFramework/Classes/Plugins/HealthKit/AWAREHealthKit.h Exposes the new helper method in the public header.
AWAREFramework.podspec Increments framework version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +200 to +206
- (void) setLastFetchTime:(NSDate * _Nullable)date withHKDataTypes:(NSSet *) types {
for (HKQuantityType * set in types) {
if(set.identifier == nil){
continue;
}
[self setLastRecordTime:date withHKDataType:set.identifier];
}
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setLastFetchTime:withHKDataTypes: enumerates HKQuantityType * even though the types set can include category/workout types (and the method name suggests any HK data type). This is inconsistent with readDataWithDataTypes: (which uses HKSampleType *) and makes the API easy to misuse. Iterate over HKObjectType */HKSampleType * (or validate element classes) and consider renaming the loop variable from set to something like dataType for clarity.

Copilot uses AI. Check for mistakes.
*/
// - (void) setLastRecordTime:(NSDate * _Nonnull)date withHKDataType:(NSString * _Nonnull)type;

- (void) setLastFetchTime:(NSDate * _Nullable)date withHKDataTypes:(NSSet *) types;
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new public method setLastFetchTime:withHKDataTypes: takes an untyped NSSet * parameter, which makes it unclear what callers are allowed to pass (and can lead to runtime errors if elements don’t respond to identifier). Consider tightening the signature (e.g., NSSet<HKSampleType *> * / NSSet<HKObjectType *> *) and adding the necessary forward declaration/import so the contract is explicit for API consumers.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants