confluentinc / confluentinc/vscode
`fetch` response is rejected in upload artifact flow
Open
on hold
- Dominant language
- TypeScript
- Stars
- 34
- Forks
- 17
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 8
Description
We're getting "promise rejected" at the fetch call [here](https://github.com/confluentinc/vscode/blob/main/src/commands/utils/uploadToS3.ts#L47) during debugging, even though **the upload flow eventually works**.
This is because [response bodies in the Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Response#instance_properties) are ReadableStreams that can only be consumed once, and the call to `response.text()` consumes the stream, marking it as "released" for any further callers. Best to use `response.clone()` to keep a readable copy around for using later.
Contributor guide
Assessment
This issue has not been assessed yet.