Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/SQLiteData/CloudKit/CloudKit+StructuredQueries.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
}

@discardableResult
package func setValue(
package func setBytes(
_ newValue: [UInt8],
forKey key: CKRecord.FieldKey,
at userModificationTime: Int64
Expand Down Expand Up @@ -252,7 +252,7 @@
let value = Value(queryOutput: row[keyPath: keyPath])
switch value.queryBinding {
case .blob(let value):
setValue(value, forKey: column.name, at: userModificationTime)
setBytes(value, forKey: column.name, at: userModificationTime)
Comment on lines 254 to +255
Copy link
Author

Choose a reason for hiding this comment

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

@stephencelis I was hoping the impact of this bug would be in tests only, but I had to change this line here in CKRecord.update to fix things, and unfortunately it's called by SyncEngine. I believe this means that anyone who's already been building/running/deploying with Xcode 26.4 will have to contend with this behavioral change having impacted how data is stored (blobs directly in the record vs CKAsset), and address any side effects stemming from that. Can you confirm if this is something we need to be concerned about?

I also see that you made the change to support Xcode 26.4 last month with release 1.6.0. Were the tests passing with early Xcode 26.4 betas? I jumped straight from 26.3 to 26.4 RC, so it's possible the behavior change may have been introduced in a later beta build or RC.

case .bool(let value):
setValue(value, forKey: column.name, at: userModificationTime)
case .double(let value):
Expand Down
2 changes: 1 addition & 1 deletion Tests/SQLiteDataTests/CloudKitTests/AssetsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
recordID: RemindersListAsset.recordID(for: 1)
)
remindersListAssetRecord.setValue("1", forKey: "id", at: now)
remindersListAssetRecord.setValue(
remindersListAssetRecord.setBytes(
Array("image".utf8),
forKey: "coverImage",
at: now
Expand Down
8 changes: 4 additions & 4 deletions Tests/SQLiteDataTests/CloudKitTests/SchemaChangeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@
let personalListRecord = try syncEngine.private.database.record(
for: RemindersList.recordID(for: 1)
)
personalListRecord.setValue(Array("image".utf8), forKey: "image", at: now)
personalListRecord.setBytes(Array("image".utf8), forKey: "image", at: now)

try await syncEngine.modifyRecords(
scope: .private,
Expand Down Expand Up @@ -775,15 +775,15 @@
let personalListRecord = try syncEngine.private.database.record(
for: RemindersList.recordID(for: 1)
)
personalListRecord.setValue(Array("personal-image".utf8), forKey: "image", at: now)
personalListRecord.setBytes(Array("personal-image".utf8), forKey: "image", at: now)
let businessListRecord = try syncEngine.private.database.record(
for: RemindersList.recordID(for: 2)
)
businessListRecord.setValue(Array("business-image".utf8), forKey: "image", at: now)
businessListRecord.setBytes(Array("business-image".utf8), forKey: "image", at: now)
let secretListRecord = try syncEngine.private.database.record(
for: RemindersList.recordID(for: 3)
)
secretListRecord.setValue(Array("secret-image".utf8), forKey: "image", at: now)
secretListRecord.setBytes(Array("secret-image".utf8), forKey: "image", at: now)

try await syncEngine.modifyRecords(
scope: .private,
Expand Down