Skip to content
New issue

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

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

Already on GitHub? # to your account

Support Strict Concurrency #23

Merged
merged 8 commits into from
Aug 13, 2024
Merged

Support Strict Concurrency #23

merged 8 commits into from
Aug 13, 2024

Conversation

Supereg
Copy link
Member

@Supereg Supereg commented Aug 11, 2024

Support Strict Concurrency

♻️ Current situation & Problem

This PR updates SpeziHealthKit to enable strict concurrency checking and provides compatibility with Swift 6.

NSPredicate is not Sendable (see a discussion here). Therefore, CollectSample and CollectSamples cannot be Sendable. These types are usually constructed in the configuration section which runs on the MainActor. Therefore, instances of CollectSample, ... can never leave the @MainActor. This is why this PR constraints a lot of the implementation to the MainActor.

⚙️ Release Notes

  • Swift 6 Compatibility.

📚 Documentation

--

✅ Testing

--

📝 Code of Conduct & Contributing Guidelines

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

@Supereg Supereg changed the title Strict concurrency Support Strict Concurrency Aug 12, 2024
@Supereg Supereg marked this pull request as ready for review August 12, 2024 07:50
Copy link

codecov bot commented Aug 12, 2024

Codecov Report

Attention: Patch coverage is 85.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 71.83%. Comparing base (1e9cb5a) to head (4d20384).

Files Patch % Lines
...hKit/CollectSample/HealthKitSampleDataSource.swift 80.77% 5 Missing ⚠️
... Extensions/HKHealthStore+BackgroundDelivery.swift 66.67% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
+ Coverage   70.16%   71.83%   +1.68%     
==========================================
  Files          11       11              
  Lines         459      465       +6     
==========================================
+ Hits          322      334      +12     
+ Misses        137      131       -6     
Files Coverage Δ
.../SpeziHealthKit/CollectSample/CollectSamples.swift 100.00% <ø> (ø)
...Extensions/HKHealthStore+AnchoredObjectQuery.swift 85.19% <ø> (ø)
...althKit Extensions/HKHealthStore+SampleQuery.swift 0.00% <ø> (ø)
Sources/SpeziHealthKit/HealthKit.swift 85.72% <100.00%> (+0.84%) ⬆️
...hKit/HealthKitDataSource/HealthKitDataSource.swift 100.00% <100.00%> (ø)
...hKitDeliverySetting/HealthKitDeliverySetting.swift 100.00% <ø> (ø)
... Extensions/HKHealthStore+BackgroundDelivery.swift 61.20% <66.67%> (+2.58%) ⬆️
...hKit/CollectSample/HealthKitSampleDataSource.swift 93.84% <80.77%> (+0.42%) ⬆️

Continue to review full report in Codecov by Sentry.

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

@Supereg Supereg requested a review from PSchmiedmayer August 12, 2024 08:32
@PSchmiedmayer PSchmiedmayer added the enhancement New feature or request label Aug 13, 2024
Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

Thank you for the work here; very nice to see the updates in this package! 🚀

@Supereg Supereg merged commit fbdec78 into main Aug 13, 2024
8 checks passed
@Supereg Supereg deleted the feature/strict-concurrency branch August 13, 2024 08:34
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants