Skip to content

Commit 9d2f475

Browse files
authored
Fix deadlock in sqlite Connection.sync by moving publishers off of "SQLite.Database" queue (#1406)
1 parent 3bdc4b7 commit 9d2f475

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

AmplifyPlugins/DataStore/AWSDataStoreCategoryPlugin/Sync/SubscriptionSync/ReconcileAndLocalSave/ReconcileAndLocalSaveOperation.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class ReconcileAndLocalSaveOperation: AsynchronousOperation {
126126
do {
127127
try storageAdapter.transaction {
128128
queryPendingMutations(forModelIds: remoteModelIds)
129+
.subscribe(on: workQueue)
129130
.flatMap { mutationEvents -> Future<([RemoteModel], [LocalMetadata]), DataStoreError> in
130131
let remoteModelsToApply = self.reconcile(remoteModels, pendingMutations: mutationEvents)
131132
return self.queryLocalMetadata(remoteModelsToApply)

0 commit comments

Comments
 (0)