I have two methods that chained by flatMap
return requests
.combineLatest()
.flatMap({ response in
Log.warning("\(response)")
do {
return try self.uploadFS(connections: response.map({ $0.connection }))
} catch {
return Just([Common_Empty]()).eraseToAnyPublisher()
}
})
.eraseToAnyPublisher()
upload fs method returns own publisher
func uploadFS() -> AnyPublisher<[Common_Empty], Never> {
let requests = makeRequests()
return requests// return requests
.combineLatest()
// .sink(
// receiveCompletion: { completion in
// Log.info("\(completion)")
// },
// receiveValue: { value in
// Log.info("Recieved value: \(value)")
// }
// )
// .store(in: &Self.retainedCancellables)
.eraseToAnyPublisher()
}
if I change return type value and will return Void uncommented block will be executed, but I dont understand why completion not sent to downstream
I tried catch completion in upstream and it works