Skip to content

Commit 91d9ac9

Browse files
committed
wip
1 parent 7abda98 commit 91d9ac9

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

Sources/SharingGRDBCore/CloudKit/SyncEngine.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
)
134134
}
135135

136-
@TaskLocal package static var _isUpdatingRecord = false
136+
@TaskLocal package static var _isSynchronizingChanges = false
137137

138138
package func setUpSyncEngine() async throws {
139139
try await setUpSyncEngine(userDatabase: userDatabase, metadatabase: metadatabase)?.value
@@ -249,7 +249,7 @@
249249
}
250250

251251
try userDatabase.write { db in
252-
try Self.$_isUpdatingRecord.withValue(false) {
252+
try Self.$_isSynchronizingChanges.withValue(false) {
253253
for tableName in newTableNames {
254254
guard let table = tablesByName[tableName]
255255
else { continue }
@@ -1001,7 +1001,7 @@
10011001
else { continue }
10021002
func open<T: PrimaryKeyedTable>(_: T.Type) throws {
10031003
try userDatabase.write { db in
1004-
try Self.$_isUpdatingRecord.withValue(false) {
1004+
try Self.$_isSynchronizingChanges.withValue(false) {
10051005
switch foreignKey.onDelete {
10061006
case .cascade:
10071007
try T
@@ -1382,7 +1382,7 @@
13821382
fileprivate static var syncEngineIsUpdatingRecord: Self {
13831383
Self(.sqliteDataCloudKitSchemaName + "_" + "syncEngineIsUpdatingRecord", argumentCount: 0) {
13841384
_ in
1385-
SyncEngine._isUpdatingRecord
1385+
SyncEngine._isSynchronizingChanges
13861386
}
13871387
}
13881388

Sources/SharingGRDBCore/Internal/UserDatabase.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package struct UserDatabase {
1717
) async throws -> T {
1818
try await withEscapedDependencies { dependencies in
1919
try await database.write { db in
20-
try SyncEngine.$_isUpdatingRecord.withValue(true) {
20+
try SyncEngine.$_isSynchronizingChanges.withValue(true) {
2121
try dependencies.yield {
2222
try updates(db)
2323
}
@@ -31,7 +31,7 @@ package struct UserDatabase {
3131
) async throws -> T {
3232
try await withEscapedDependencies { dependencies in
3333
try await database.read { db in
34-
try SyncEngine.$_isUpdatingRecord.withValue(true) {
34+
try SyncEngine.$_isSynchronizingChanges.withValue(true) {
3535
try dependencies.yield {
3636
try updates(db)
3737
}
@@ -46,7 +46,7 @@ package struct UserDatabase {
4646
) throws -> T {
4747
try withEscapedDependencies { dependencies in
4848
try database.write { db in
49-
try SyncEngine.$_isUpdatingRecord.withValue(true) {
49+
try SyncEngine.$_isSynchronizingChanges.withValue(true) {
5050
try dependencies.yield {
5151
try updates(db)
5252
}
@@ -61,7 +61,7 @@ package struct UserDatabase {
6161
) throws -> T {
6262
try withEscapedDependencies { dependencies in
6363
try database.read { db in
64-
try SyncEngine.$_isUpdatingRecord.withValue(true) {
64+
try SyncEngine.$_isSynchronizingChanges.withValue(true) {
6565
try dependencies.yield {
6666
try updates(db)
6767
}

Tests/SharingGRDBTests/Internal/UserDatabaseHelpers.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extension UserDatabase {
66
_ updates: @escaping @Sendable (Database) throws -> T
77
) async throws -> T {
88
try await write { db in
9-
try SyncEngine.$_isUpdatingRecord.withValue(false) {
9+
try SyncEngine.$_isSynchronizingChanges.withValue(false) {
1010
try updates(db)
1111
}
1212
}
@@ -16,7 +16,7 @@ extension UserDatabase {
1616
_ updates: @escaping @Sendable (Database) throws -> T
1717
) async throws -> T {
1818
try await read { db in
19-
try SyncEngine.$_isUpdatingRecord.withValue(false) {
19+
try SyncEngine.$_isSynchronizingChanges.withValue(false) {
2020
try updates(db)
2121
}
2222
}
@@ -27,7 +27,7 @@ extension UserDatabase {
2727
_ updates: (Database) throws -> T
2828
) throws -> T {
2929
try write { db in
30-
try SyncEngine.$_isUpdatingRecord.withValue(false) {
30+
try SyncEngine.$_isSynchronizingChanges.withValue(false) {
3131
try updates(db)
3232
}
3333
}
@@ -38,7 +38,7 @@ extension UserDatabase {
3838
_ updates: (Database) throws -> T
3939
) throws -> T {
4040
try write { db in
41-
try SyncEngine.$_isUpdatingRecord.withValue(false) {
41+
try SyncEngine.$_isSynchronizingChanges.withValue(false) {
4242
try updates(db)
4343
}
4444
}

0 commit comments

Comments
 (0)