Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve HealthKit Module #46

Merged
merged 20 commits into from
Feb 12, 2023
Merged

Improve HealthKit Module #46

merged 20 commits into from
Feb 12, 2023

Conversation

PSchmiedmayer
Copy link
Member

@PSchmiedmayer PSchmiedmayer commented Feb 10, 2023

Improve HealthKit Module

♻️ Current situation & Problem

The HealthKit module currently requires a restart of the application to start collecting HealthKit data for background and query-based delivery.

💡 Proposed solution

  • The HealthKit module creates a default predicate to start date collection on the timestamp when the query was first created.
  • The HealthKit module now saves the query anchor for queries while the application is running and saves the anchor persistently when the option is activated in the configuration.
  • This PR improves the test coverage by reactivating the HealthKit tests, uses XCTHealthKit, and fixes the issues in the HealthKit Module.

Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@codecov
Copy link

codecov bot commented Feb 12, 2023

Codecov Report

Merging #46 (e9ad323) into main (888d153) will increase coverage by 10.46%.
The diff coverage is 92.69%.

❗ Current head e9ad323 differs from pull request most recent head 8b634db. Consider uploading reports for the commit 8b634db to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##             main      #46       +/-   ##
===========================================
+ Coverage   67.13%   77.58%   +10.46%     
===========================================
  Files          52      118       +66     
  Lines        1454     4611     +3157     
===========================================
+ Hits          976     3577     +2601     
- Misses        478     1034      +556     
Impacted Files Coverage Δ
...Extensions/HKHealthStore+AnchoredObjectQuery.swift 87.10% <ø> (ø)
...urce/CollectSample/HealthKitSampleDataSource.swift 95.90% <92.50%> (ø)
...hKitDeliverySetting/HealthKitDeliverySetting.swift 100.00% <100.00%> (ø)
Sources/Views/ViewState/ViewStateAlert.swift 100.00% <0.00%> (ø)
...urces/Views/SwiftUIHelper/DescriptionGridRow.swift 27.78% <0.00%> (ø)
Sources/Onboarding/OnboardingInformationView.swift 48.53% <0.00%> (ø)
Sources/Views/ViewState/AnyLocalizedError.swift 84.62% <0.00%> (ø)
Sources/HealthKitDataSource/HealthKit.swift 86.89% <0.00%> (ø)
Sources/Contact/Contact Views/ContactCard.swift 75.00% <0.00%> (ø)
...Username and Password/Sign Up/GenderIdentity.swift 100.00% <0.00%> (ø)
... and 71 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 888d153...8b634db. Read the comment docs.

@PSchmiedmayer PSchmiedmayer merged commit 1fe1079 into main Feb 12, 2023
@PSchmiedmayer PSchmiedmayer deleted the bugfix/healthKitTests branch February 12, 2023 07:57
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.

1 participant