Skip to content

A few fixes for Xcode 26.#180

Merged
mbrandonw merged 3 commits into
cloudkitfrom
xcode-26-fixes
Sep 15, 2025
Merged

A few fixes for Xcode 26.#180
mbrandonw merged 3 commits into
cloudkitfrom
xcode-26-fixes

Conversation

@mbrandonw
Copy link
Copy Markdown
Member

A few things I have found while working on the project in Xcode 26.

Comment on lines 1747 to +1748
|| path.hasPrefix(":memory:")
|| absoluteString.hasPrefix(":memory:")
Copy link
Copy Markdown
Member Author

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:") the path is just "memory:", i.e. the leading ":" is removed. But in a URL like URL(string: "file::memory:") it is not. And so I have found that checking both path and absoluteString seems to cover the situations we are interested in, but there may be a better way.

} matching: { issue in
issue.description == """
Issue recorded: An added share is being saved without its rootRecord being saved in the \
issue.description.hasSuffix("""
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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.

import Testing

extension BaseCloudKitTests {
@MainActor
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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 @MainActor here, so can remove.

// Please file a bug.
#if swift(<6.2)
try await withKnownIssue {
try await syncEngine.unshare(record: remindersList)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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.

)
}
)
try await Task.sleep(for: .seconds(1))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We have a similar sleep in other places, but this is needed when the sync engine is stopped since during that time we kick of unstructured tasks for dealing with the sync engine (so to avoid re-entrant database requests).

@mbrandonw mbrandonw added the cloudkit Related to our CloudKit synchronization release label Sep 15, 2025
@mbrandonw mbrandonw merged commit aa00105 into cloudkit Sep 15, 2025
5 checks passed
@mbrandonw mbrandonw deleted the xcode-26-fixes branch September 15, 2025 17:08
stephencelis added a commit that referenced this pull request Sep 17, 2025
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* a test for deletion

* Fixes #32 failure to compile in release configuration

* wip

* Fix a reference violation.

* wip

* add test

* wip

* wip

* format/

* wip

* wip

* fix tests

* fix tests

* add a test

* wip

* wip

* wip

* wip

* wip

* simplify

* wip

* Delete records in groups.

* wip

* wip

* wip

* some doc updates

* wip

* update package

* Support zones in mock cloud database.

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix dep

* wip

* wip

* Apply suggestion from @stephencelis

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Better way to process record/database changes in tests.

* Fail if we process changes without there being any changes.

* merge fix

* fix import

* Allow sync engine to be initalized with a zone.

* wip

* Updates swift-structured-queries

* 'Float16' is unavailable in Mac Catalyst

While Xcode’s error says 'Float16' is unavailable in Mac Catalyst, the docs suggest it is available on Apple silicon, and unavailable on Intel when targeting macOS. Checking for Intel allows archiving for catalyst.

* Account management.

* Handle account lifecycle events.

* wip

* Support account status in mock cloud kit.

* wip

* wip

* Derive metadatabase URL from database URL

* wip

* wip

* wip

* updates to docs

* write test for certain ck scenario

* wip

* Revert "wip"

This reverts commit ba77edd.

* wip

* get rid of uuid zeros

* docs

* wip

* wip

* Public method for fetching metadata.

* Revert "Public method for fetching metadata."

This reverts commit 6519f17.

* Public method for fetching metadata.

* Apply suggestions from code review

* wip

* wip;

* Update Tests/SharingGRDBTests/Internal/BaseCloudKitTests.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Update Tests/SharingGRDBTests/CloudKitTests/AccountLifecycleTests.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* wip

* fix

* fix test

* wip

* wip

* wip

* todos

* Support in-memory metadatabase.

* wip

* wip

* fix merge

* Improve `SyncEngine.init` (#113)

* Improve `SyncEngine.init`

- Infer default cloud container using SwiftData
- Statically require string identifier primary keyed tables

* wip

* wip

* fix test

* wip

* wip

* wip

* Regenerate macro code for CloudKit tables. (#120)

* Regenerate macro code for CloudKit tables.

* formatting

* fix warnings

* fix typo

* wip

* Add Tagged support to SharingGRDB

* Add uniqueness to tag titles. (#119)

* Add uniqueness to tag titles.

* wip

* wip

* wip

* wip

* wip

* wip

* Improve un-sharing records.

* Add Available Permissions (#123)

Co-authored-by: David Moeller <david.moller@sensorfact.nl>

* Make sync engine play nicely with tests (#124)

* wip

* control dates internally

* wip

* wip

* add a test

* wip

* Handling more CloudKit sharing edge cases (#126)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* clean up

* wip

* wip

* wip

* wip

* Making sharing more testable (#128)

* Beginnings of making sharing more testable.

* wip

* wip

* wip

* wip

* fixes

* wip

* More sharing tests and improvements (#129)

* Fixing more sharing edge cases with tests.

* wip

* wip

* wip

* wip

* dont emit error when unsharing unshared record.

* wip

* fix

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Test for generated column behavior. (#136)

* Test for generated column behavior.

* snap

* wip

* Revert examples

* wip

* wip

* wip

* Fix upsert for tables that only have a primary key.

* add some tests

* Add `SyncEngine.{start,stop,isRunning}` (#142)

* Add `SyncEngine.{start,stop}()`

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Remove unneeded sleeps

* format

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>

* CloudKit: Compile tests on non-macOS platforms (#144)

* CloudKit: Compile tests on non-macOS platforms

* Bump GRDB requirement

* wip

* wip

* wip

* Minimize exports

* wip

* wip

* Remove trigger check

* Some permission fixes (#147)

* Fix up some permission loopholes.

* wip

* wip

* clean up

* Document scene delegate methods for accepting shares. (#148)

* Document scene delegate methods for accepting shares.

* Update Sources/SharingGRDBCore/Documentation.docc/Articles/CloudKitSharing.md

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Clean up some tests

* Add link to apple docs for deploying schema

* update docs wrt SyncEngine.isSychnronizing

* Delete CK record when updating primary key. (#151)

* Delete CK record when updating primary key.

* wip

* wip

* Validate foreign keys point to synchronized tables. (#152)

* wip

* Lots of updates to docs. (#153)

* Lots of updates to docs.

* db error

* fixes

* Beginning of renaming package to SQLiteData.

* Rename more things.

* wip

* flatten

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix test

* wip

* More docs (#154)

* More docs

* wip

* wip

* wip

* wip

* Format SQLiteData entry in README.md table

* wip

* Update Sources/SQLiteData/CloudKit/CloudKitSharing.swift

* Update Sources/SQLiteData/Documentation.docc/Articles/CloudKit.md

* Update Sources/SQLiteData/CloudKit/SyncMetadata.swift

* Format SQLiteData performance table for clarity

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Fetch pending record zone changes through metadatabase (#155)

* wip

* docs on uniqueness

* Update README.md

* wip

* Triage some todos (#157)

* Triage todos'

* wip

* wip

* wip

* wip

* wip

* CloudKit docs organization (#158)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Add observation to `SyncEngine.isRunning` (#159)

* Add observation to `SyncEngine.isRunning`

* wip

* wip

* wip

* wip

* wip

* fix

* finish test

* Add test for cyclic schemas'

* docs on PK migration

* wip

* docs

* Audit reading from metadatabase (#161)

* Audit metadatabase

* convert more userDatabase to metadatabase

* wip

* wip

* wip

* wip

* format

* wip

* docs

* CloudKit sqlite data pragmas (#162)

* CloudKit: Use virtual table helpers

Let's prefer our builder over SQL strings when it's easy to do so.

* wip

* wip

* wip

* wip

* Move menu into toolbar hstack.

* Fix tests for iOS. (#165)

* Optimize a few sync metadata queries (#169)

Let's select/decode just the data we need.

* More efficient joins to SyncMetadata table (#163)

* Improve tools for joining SyncMetadata table.

* wip

* wip

* wip

* wip

* wip

* wip

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Make upsertFromServerRecord async. (#170)

Co-authored-by: Brandon Williams <mbrandonw@hey.com>

* Cloudkit sqlite data send changes background (#167)

* Immediately send pending changes when backgrounding app.

* wip;

* Revert "wip;"

This reverts commit fb68ce7.

* wip

* Revert "Revert "wip;""

This reverts commit 2ddfe3d.

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Upload unknown records to CloudKit on sign in. (#168)

* Upload unknown records to CloudKit on sign in.

* fix tests

* wip

* wip

* wip

* merge fix

* wip;

* Fix sign out. (#164)

* Fix sign out.

* wip

* fix

* Apply suggestions from code review

* merge fix

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* fixes

* wip

* wip

* wip

* wip

* wip

* Add `database` for context-sensitive provisioning (#175)

* Add `database` for context-sensitive provisioning

This small helper will take live/test/preview into account to simplify
how folks bootstrap their databases.

* wip

* wip

* Update DefaultDatabase.swift

* wip

* another way to get container identifier

* Modernize SyncUps and add iCloud sync. (#176)

* Modernize SyncUps and add iCloud sync.

* fix tests

* Send sync engine changes on resign foreground. (#177)

* Send changes when resigining active.

* fix

* wip

* Bring back other demo apps. (#178)

* Bring back other demo apps.

* wip

* Rename more references to sqlite-data

* wip

* wip

* wip

* go back to getting cloudkit container identifier from swiftdata

* wip

* A few fixes for Xcode 26. (#180)

* A few fixes for Xcode 26.

* wip

* wip

* Throw error when changing zones for existing record (#179)

* Throw error when moving records between zones.

* wip

* wip

* wip

* wip

* Fix floating point bug (#183)

* Fix floating point comparison bug.

* wip

* wip

* wip;

* wipa

* wip

* wip

* wipa

* Fix Examples/README: project reference (#186)

* Update README.md

- Replace the removed `SharingGRDB.xcworkspace` reference with `Examples.xcodeproj`.
- Explain that each example app is worked on individually by selecting its scheme in Xcode.

* Update README.md

* Perform multiple upserts in a single transaction. (#185)

* Perform multiple upserts in a single transaction.

* wip

* wip

* wip

* wip

* Only reference UIApplication on iOS (#190)

* Modernize reminders (#184)

* Modernize reminders with triggers.

* wip;

* wip

* wip;

* wip

* wip

* wip

* Update Examples/Reminders/Schema.swift

* fix tests

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Add zone to sync metadata (#187)

* Store zone data in sync metadata.

* wip

* wip

* wip

* wip

* wip

* wip

* Support moving records across zones (#188)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* clean up

* fix snapshot

* wip

* wip

* wip

* wip

* support moving shares between zones and receiving saves before deletes

* wip

* Update Sources/SQLiteData/CloudKit/Internal/Triggers.swift

* wip

* wip

* wip

* format

* wip;

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* wip

* Fix zone deletion (#192)

* wip

* wip

* wip

---------

Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>
Co-authored-by: Brandon Williams <mbrandonw@hey.com>
Co-authored-by: Rob Feldmann <me@robfeldmann.com>
Co-authored-by: David Moeller <david_moeller@me.com>
Co-authored-by: David Moeller <david.moller@sensorfact.nl>
Co-authored-by: Yoshinori Imajo <y.imajo@gmail.com>
Co-authored-by: Michael Thingnes <thimic@users.noreply.github.com>
mackoj pushed a commit to mackoj/sqlite-data that referenced this pull request Dec 5, 2025
* Support defaults in `@Selection.Columns.init`

* Update Triggers.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cloudkit Related to our CloudKit synchronization release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants