-
Couldn't load subscription status.
- Fork 9
Handle and work around concurrency warnings #23
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,9 +1,9 @@ | ||||||
| CONFIG = debug | ||||||
| PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iPhone,iOS-16) | ||||||
| PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS,iPhone \d\+ Pro [^M]) | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix regex: grep default doesn’t support \d. Use -E and [0-9]+; tighten Pro-not-Max match Current pattern won’t match digits; it literally searches for "d+". Also ensure we exclude "Pro Max" robustly. Apply: -PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS,iPhone \d\+ Pro [^M])
+PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS,iPhone [0-9]+ Pro( \(|$$))Note: The pattern matches “… Pro (” or end-of-line, excluding “Pro Max …”. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| PLATFORM_MACOS = macOS | ||||||
| PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst | ||||||
| PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,TV,tvOS-16) | ||||||
| PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,Watch,watchOS-9) | ||||||
| PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,tvOS,TV) | ||||||
| PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,watchOS,Watch) | ||||||
|
|
||||||
| default: swift-test | ||||||
|
|
||||||
|
|
@@ -49,5 +49,5 @@ test-swift: | |||||
| .PHONY: test-example test-swift build-for-library-evolution format | ||||||
|
|
||||||
| define udid_for | ||||||
| $(shell xcrun simctl list --json devices available $(1) | jq -r '.devices | to_entries | map(select(.value | add)) | sort_by(.key) | .[] | select(.key | contains("$(2)")) | .value | last.udid') | ||||||
| $(shell xcrun simctl list devices available '$(1)' | grep '$(2)' | sort -r | head -1 | awk -F '[()]' '{ print $$(NF-3) }') | ||||||
|
||||||
| $(shell xcrun simctl list devices available '$(1)' | grep '$(2)' | sort -r | head -1 | awk -F '[()]' '{ print $$(NF-3) }') | |
| $(shell xcrun simctl list devices available '$(1)' | grep '$(2)' | sort -r | head -1 | grep -Eo '[0-9A-Fa-f-]{36}' | head -1) |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||
| import UserNotifications | ||||||||||
| @preconcurrency import UserNotifications | ||||||||||
| import XCTestDynamicOverlay | ||||||||||
|
|
||||||||||
| /// A wrapper around UserNotifications's `UNUserNotificationCenter` that exposes its functionality through | ||||||||||
|
|
@@ -8,17 +8,20 @@ import XCTestDynamicOverlay | |||||||||
| @available(macOS 10.14, *) | ||||||||||
| @available(tvOS 10.0, *) | ||||||||||
| @available(watchOS 3.0, *) | ||||||||||
| public struct UserNotificationClient { | ||||||||||
| public struct UserNotificationClient: Sendable { | ||||||||||
| /// Actions that correspond to `UNUserNotificationCenterDelegate` methods. | ||||||||||
| /// | ||||||||||
| /// See `UNUserNotificationCenterDelegate` for more information. | ||||||||||
| public enum DelegateAction { | ||||||||||
| public enum DelegateAction: Sendable { | ||||||||||
| case willPresentNotification( | ||||||||||
| _ notification: Notification, | ||||||||||
| completionHandler: (UNNotificationPresentationOptions) -> Void) | ||||||||||
| completionHandler: @Sendable (UNNotificationPresentationOptions) -> Void) | ||||||||||
|
|
||||||||||
| @available(tvOS, unavailable) | ||||||||||
| case didReceiveResponse(_ response: Notification.Response, completionHandler: () -> Void) | ||||||||||
| case didReceiveResponse( | ||||||||||
| _ response: Notification.Response, | ||||||||||
| completionHandler: @Sendable () -> Void | ||||||||||
| ) | ||||||||||
|
|
||||||||||
| case openSettingsForNotification(_ notification: Notification?) | ||||||||||
| } | ||||||||||
|
|
@@ -32,41 +35,41 @@ public struct UserNotificationClient { | |||||||||
| #endif | ||||||||||
|
|
||||||||||
| #if !os(tvOS) | ||||||||||
| public var notificationCategories: () async -> Set<UNNotificationCategory> = unimplemented( | ||||||||||
| public var notificationCategories: @Sendable () async -> Set<UNNotificationCategory> = unimplemented( | ||||||||||
| "\(Self.self).deliveredNotifications") | ||||||||||
|
Comment on lines
+38
to
39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo in unimplemented placeholder Use the correct label to aid debugging. - public var notificationCategories: @Sendable () async -> Set<UNNotificationCategory> = unimplemented(
- "\(Self.self).deliveredNotifications")
+ public var notificationCategories: @Sendable () async -> Set<UNNotificationCategory> = unimplemented(
+ "\(Self.self).notificationCategories")📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| #endif | ||||||||||
|
|
||||||||||
| public var notificationSettings: () async -> Notification.Settings = unimplemented( | ||||||||||
| public var notificationSettings: @Sendable () async -> Notification.Settings = unimplemented( | ||||||||||
| "\(Self.self).notificationSettings") | ||||||||||
|
|
||||||||||
| public var pendingNotificationRequests: () async -> [Notification.Request] = unimplemented( | ||||||||||
| public var pendingNotificationRequests: @Sendable () async -> [Notification.Request] = unimplemented( | ||||||||||
| "\(Self.self).pendingNotificationRequests") | ||||||||||
|
|
||||||||||
| #if !os(tvOS) | ||||||||||
| public var removeAllDeliveredNotifications: () async -> Void = unimplemented( | ||||||||||
| public var removeAllDeliveredNotifications: @Sendable () async -> Void = unimplemented( | ||||||||||
| "\(Self.self).removeAllDeliveredNotifications") | ||||||||||
| #endif | ||||||||||
|
|
||||||||||
| public var removeAllPendingNotificationRequests: () async -> Void = unimplemented( | ||||||||||
| public var removeAllPendingNotificationRequests: @Sendable () async -> Void = unimplemented( | ||||||||||
| "\(Self.self).removeAllPendingNotificationRequests") | ||||||||||
|
|
||||||||||
| #if !os(tvOS) | ||||||||||
| public var removeDeliveredNotificationsWithIdentifiers: ([String]) async -> Void = | ||||||||||
| public var removeDeliveredNotificationsWithIdentifiers: @Sendable ([String]) async -> Void = | ||||||||||
| unimplemented("\(Self.self).removeDeliveredNotificationsWithIdentifiers") | ||||||||||
| #endif | ||||||||||
|
|
||||||||||
| public var removePendingNotificationRequestsWithIdentifiers: ([String]) async -> Void = | ||||||||||
| public var removePendingNotificationRequestsWithIdentifiers: @Sendable ([String]) async -> Void = | ||||||||||
| unimplemented("\(Self.self).removePendingNotificationRequestsWithIdentifiers") | ||||||||||
|
|
||||||||||
| public var requestAuthorization: (UNAuthorizationOptions) async throws -> Bool = | ||||||||||
| public var requestAuthorization: @Sendable (UNAuthorizationOptions) async throws -> Bool = | ||||||||||
| unimplemented("\(Self.self).requestAuthorization") | ||||||||||
|
|
||||||||||
| #if !os(tvOS) | ||||||||||
| public var setNotificationCategories: (Set<UNNotificationCategory>) async -> Void = | ||||||||||
| public var setNotificationCategories: @Sendable (Set<UNNotificationCategory>) async -> Void = | ||||||||||
| unimplemented("\(Self.self).setNotificationCategories") | ||||||||||
| #endif | ||||||||||
|
|
||||||||||
| public var supportsContentExtensions: () -> Bool = unimplemented( | ||||||||||
| public var supportsContentExtensions: @Sendable () -> Bool = unimplemented( | ||||||||||
| "\(Self.self).supportsContentExtensions") | ||||||||||
|
|
||||||||||
| /// This Effect represents calls to the `UNUserNotificationCenterDelegate`. | ||||||||||
|
|
||||||||||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update checkout action to v4 (v3 is too old on macos-15)
This will avoid runner/runtime warnings.
Apply:
📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.8)
24-24: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🤖 Prompt for AI Agents