amplify-swift icon indicating copy to clipboard operation
amplify-swift copied to clipboard

DataStore ReconcileAndLocalSaveOperationTests fails on Xcode 13.4.1

Open lawmicha opened this issue 3 years ago • 0 comments

Describe the bug

The following unit tests are failing in the test class ReconcileAndLocalSaveOperationTests

  • testApplyRemoteModels_saveFail
  • testApplyRemoteModels_deleteFail
  • testApplyRemoteModels_saveMetadataFail

Steps To Reproduce

Save model success
Save model success
Save model success
Save model success
Save model success
Save model success
Save metadata failed
mutationEventDropped(modelName: "Post", error: Optional(DataStoreError: Failed to save metadata))

The relevant code in ReconcileAndLocalSaveOperation

Publishers.MergeMany(publishers)
                .collect()
                .sink(
                    receiveCompletion: {
                        if case .failure(let error) = $0 {
                            result = .failure(error)
                        }
                    },
                    receiveValue: { _ in
                        result = .successfulVoid
                    }
                )
                .store(in: &self.cancellables)

It appears the Publisher.MergeMany(publishers).collect() is returning a completion event on the first failure

I think we need to identify what changes in the latest Swift version and behavior change in the Combine Publishers. Is it a regression or new behavior going forward?

lawmicha avatar Jun 14 '22 18:06 lawmicha