When looking through the code I noticed that the Task created in startWriterTask doesn't catch or consume errors and nothing awaits the Task completion. The upshot is that any errors thrown here are ignored which is likely to be problematic.
|
let task = Task { |
|
dispatchPrecondition(condition: .notOnQueue(Self.streamQueue)) |
|
for try await chunk in httpBody { |
|
try await withCheckedThrowingContinuation { continuation in |
|
Self.streamQueue.async { |
|
debug("Output stream delegate produced chunk and suspended producer.") |
|
self.performAction(self.state.producedChunkAndSuspendedProducer(chunk, continuation)) |
|
} |
|
} |
|
} |
|
Self.streamQueue.async { |
|
debug("Output stream delegate wrote final chunk.") |
|
self.performAction(self.state.wroteFinalChunk()) |
|
} |
|
} |
When looking through the code I noticed that the
Taskcreated instartWriterTaskdoesn't catch or consume errors and nothing awaits theTaskcompletion. The upshot is that any errors thrown here are ignored which is likely to be problematic.swift-openapi-urlsession/Sources/OpenAPIURLSession/URLSessionBidirectionalStreaming/HTTPBodyOutputStreamBridge.swift
Lines 63 to 77 in cea6929