Use metadatabase to query sync metadata.#270
Merged
Merged
Conversation
stephencelis
approved these changes
Oct 23, 2025
mbrandonw
commented
Oct 24, 2025
| @@ -0,0 +1,69 @@ | |||
| #if canImport(CloudKit) | |||
Member
Author
There was a problem hiding this comment.
Added a new test suite to specifically test joining to the metadatabase when it is attached.
mbrandonw
commented
Oct 24, 2025
| } | ||
|
|
||
| @available(iOS 17, macOS 14, tvOS 17, watchOS 10, *) | ||
| @Test func deleteShare() async throws { |
Member
Author
There was a problem hiding this comment.
This test was failing prior to the change made in this PR.
mbrandonw
commented
Oct 24, 2025
| $0.dataManager = InMemoryDataManager() | ||
| } | ||
| }, | ||
| .attachMetadatabase(false) |
Member
Author
There was a problem hiding this comment.
Let's not attach the metadatabase in tests by default, and instead opt into it explicitly.
mbrandonw
commented
Oct 24, 2025
| struct ModifyRecordsCallback { | ||
| fileprivate let operation: @Sendable () async -> Void | ||
| func notify() async { | ||
| struct ModifyRecordsCallback<ReturnValue> { |
Member
Author
There was a problem hiding this comment.
Currently when we invoke notify() in tests it doesn't return the results from the modify… call. So I updated this bit of library code to allow for that in future tests that may want to assert on that information directly.
bok-
pushed a commit
to bok-/sqlite-data-with-traits
that referenced
this pull request
Dec 15, 2025
* Use metadatabase to query sync metadata. * Added a test * dont attach metadatabase for base suite. * add test for attached metadatabase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All reads/writes to the metadatabase should happen through the dedicated metadatabase connection because the user's connection may not have the metadatabase attached. This can be tricky to get right, and we seem to have a spot where we forgot to use the metadatabase directly.