apple / apple/swift-openapi-urlsession
`startWriterTask()` discards errors thrown from consuming the `httpBody`
- Dominant language
- Swift
- Stars
- 216
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Description
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.
https://github.com/apple/swift-openapi-urlsession/blob/cea6929e2907a79fb1b5c8dc1518dbba41a60c75/Sources/OpenAPIURLSession/URLSessionBidirectionalStreaming/HTTPBodyOutputStreamBridge.swift#L63-L77
Contributor guide
Research direction
Start in Sources/OpenAPIURLSession/URLSessionBidirectionalStreaming/HTTPBodyOutputStreamBridge.swift at startWriterTask(), especially the linked lines 63–77. Trace how the created Task consumes httpBody and how its completion is handled. Done means errors from consuming httpBody are no longer silently discarded and the relevant behavior is covered by the existing test suite.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100