Skip to content

Commit

Permalink
Minor concurrency adjustments (#114)
Browse files Browse the repository at this point in the history
# Minor concurrency adjustments

## ♻️ Current situation & Problem
With Xcode Beta 5 there are new region-based concurrency checks that
trigger a warning about strongly transferred parameters (see
[SE-0414](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0414-region-based-isolation.md#using-transferring-to-simplify-nonisolated-actor-initializers-and-actor-deinitializers))
when passing actor isolated closures that is not explicitly marked as
`@Sendable`.
This PR resolves those warning by adding an explicit `@Sendable`
annotation.

Interestingly the Swift Package Index marks Spezi 1.7.1 to be Swift 6
compatible even though they compile the project with Beta 5.

## ⚙️ Release Notes 
* Minor concurrency adjustments.


## 📚 Documentation
--


## ✅ Testing
--

## 📝 Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
Supereg authored Aug 15, 2024
1 parent 87d735b commit 7755013
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/Spezi/Spezi/SpeziAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ open class SpeziAppDelegate: NSObject, ApplicationDelegate, Sendable {

let result: Set<BackgroundFetchResult> = await withTaskGroup(of: BackgroundFetchResult.self) { @MainActor group in
for handler in handlers {
group.addTask { @MainActor in
group.addTask { @Sendable @MainActor in
await handler.receiveRemoteNotification(userInfo)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Spezi/Spezi/SpeziNotificationCenterDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SpeziNotificationCenterDelegate: NSObject {
}

for handler in delegate.spezi.notificationHandler {
group.addTask { @MainActor in
group.addTask { @Sendable @MainActor in
await handler.handleNotificationAction(response)
}
}
Expand Down

0 comments on commit 7755013

Please sign in to comment.