Repository navigation
Skip empty HTTPBody chunks in the URLSession stream bridge - #96
Conversation
|
@czechboy0 Based on the discussion in #85, should we work around the assert here or make it impossible to vend an empty chunk from the runtime? |
|
We need to make it legal to send an empty chunk, but exactly how that should be done here I'd defer to @simonjbeaumont and you about. We definitely can't add a new requirement into Runtime, as it could break some adopters who use empty chunks already with other transports. |
|
saw the thread. this PR only skips empty chunks in the URLSession bridge so the assert does not fire. if yall want empty chunks to stay legal somewhere else in Runtime that is above my pay grade, bro i dont know that lmao. happy to tweak this transport side if you land on a preferred approach. |
|
@guoye-zhang any update? this one's approved and green on my side, wondering if it's waiting on anything else |
|
Great. When will this PR be released? |
|
Released as 1.3.2 |
Fixes #85
An empty text/plain request body vends a zero length chunk. The output stream bridge then tried to write that chunk and hit a precondition. Maintainers agreed the transport should send an empty body.
Empty chunks are now skipped so the stream closes with a zero length body instead of crashing.
Test plan
Added testHTTPBodyOutputStreamEmptyChunkDoesNotCrash covering a single empty chunk. Built the OpenAPIURLSession product. Full XCTest suite needs Xcode.