-
Notifications
You must be signed in to change notification settings - Fork 113
A few fixes for Xcode 26. #180
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
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #if swift(>=6.2) | ||
| public typealias _SendableMetatype = SendableMetatype | ||
| #else | ||
| public typealias _SendableMetatype = Any | ||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -392,10 +392,10 @@ | |
| try withKnownIssue { | ||
| _ = try syncEngine.modifyRecords(scope: .private, saving: [share]) | ||
| } matching: { issue in | ||
| issue.description == """ | ||
| Issue recorded: An added share is being saved without its rootRecord being saved in the \ | ||
| issue.description.hasSuffix(""" | ||
|
Member
Author
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. We need to start just doing suffix checks since Testing now puts the issue level in its messages. |
||
| An added share is being saved without its rootRecord being saved in the \ | ||
| same operation. | ||
| """ | ||
| """) | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,6 @@ | |
| import Testing | ||
|
|
||
| extension BaseCloudKitTests { | ||
| @MainActor | ||
|
Member
Author
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. This was causing sendability problems in the test that I think are probably just Swift bugs. But we don't actually need |
||
| final class SchemaChangeTests: BaseCloudKitTests, @unchecked Sendable { | ||
| @Dependency(\.dataManager) var dataManager | ||
| var inMemoryDataManager: InMemoryDataManager { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -517,24 +517,31 @@ | |
| } | ||
| } | ||
|
|
||
| @available(iOS 17, macOS 14, tvOS 17, watchOS 10, *) | ||
| @Test func unshareNonSharedRecord() async throws { | ||
| let remindersList = RemindersList(id: 1, title: "Personal") | ||
| try await userDatabase.userWrite { db in | ||
| try db.seed { | ||
| remindersList | ||
| // NB: Swift 6.2 cannot currently compile this: | ||
| // Pattern that the region based isolation checker does not understand how to check. | ||
| // Please file a bug. | ||
| #if swift(<6.2) | ||
| @available(iOS 17, macOS 14, tvOS 17, watchOS 10, *) | ||
| @Test func unshareNonSharedRecord() async throws { | ||
| let remindersList = RemindersList(id: 1, title: "Personal") | ||
| try await userDatabase.userWrite { db in | ||
| try db.seed { | ||
| remindersList | ||
| } | ||
| } | ||
| try await syncEngine.processPendingRecordZoneChanges(scope: .private) | ||
|
|
||
| try await withKnownIssue { | ||
| try await syncEngine.unshare(record: remindersList) | ||
|
Member
Author
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. As the comment above says, Swift 6.2 can't handle this for some reason. |
||
| } matching: { issue in | ||
| issue.description.hasSuffix( | ||
| """ | ||
| Issue recorded: No share found associated with record. | ||
| """ | ||
| ) | ||
| } | ||
| } | ||
| try await syncEngine.processPendingRecordZoneChanges(scope: .private) | ||
|
|
||
| try await withKnownIssue { | ||
| try await syncEngine.unshare(record: remindersList) | ||
| } matching: { issue in | ||
| issue.description == """ | ||
| Issue recorded: No share found associated with record. | ||
| """ | ||
| } | ||
| } | ||
| #endif | ||
|
|
||
| @available(iOS 17, macOS 14, tvOS 17, watchOS 10, *) | ||
| @Test func shareUnshareShareAgain() async throws { | ||
|
|
@@ -629,7 +636,9 @@ | |
| ) | ||
| _ = try syncEngine.modifyRecords(scope: .shared, saving: [share, remindersListRecord]) | ||
| let freshShare = try syncEngine.shared.database.record(for: share.recordID) as! CKShare | ||
| let freshRemindersListRecord = try syncEngine.shared.database.record(for: remindersListRecord.recordID) | ||
| let freshRemindersListRecord = try syncEngine.shared.database.record( | ||
| for: remindersListRecord.recordID | ||
| ) | ||
|
|
||
| try await syncEngine | ||
| .acceptShare( | ||
|
|
||
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.
I am finding that for a URL like
URL(string: ":memory:")thepathis just "memory:", i.e. the leading ":" is removed. But in a URL likeURL(string: "file::memory:")it is not. And so I have found that checking bothpathandabsoluteStringseems to cover the situations we are interested in, but there may be a better way.