Skip to content

Commit 3986cf5

Browse files
authored
fix: Mark outgoing mutation as inProcess if nextEventPromise exists (#392)
1 parent 352680b commit 3986cf5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

AmplifyPlugins/DataStore/AWSDataStoreCategoryPlugin/Sync/MutationSync/AWSMutationDatabaseAdapter/AWSMutationDatabaseAdapter+MutationEventIngester.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ extension AWSMutationDatabaseAdapter: MutationEventIngester {
202202
completionPromise: @escaping Future<MutationEvent, DataStoreError>.Promise) {
203203

204204
log.verbose("\(#function) mutationEvent: \(mutationEvent)")
205-
storageAdapter.save(mutationEvent, condition: nil) { result in
205+
var eventToPersist = mutationEvent
206+
if nextEventPromise != nil {
207+
eventToPersist.inProcess = true
208+
}
209+
storageAdapter.save(eventToPersist, condition: nil) { result in
206210
switch result {
207211
case .failure(let dataStoreError):
208212
self.log.verbose("\(#function): Error saving mutation event: \(dataStoreError)")

0 commit comments

Comments
 (0)