Skip to content

Commit c46096d

Browse files
committed
style(github-copilot): clarify response release ordering
1 parent 840c42e commit c46096d

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎extensions/github-copilot/login.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,7 @@ async function postGitHubDeviceFlowForm(params: {
161161
});
162162
try {
163163
if (!response.ok) {
164-
// GitHub OAuth error responses ship a JSON body (`{error, error_description}`)
165-
// that this helper does not consume. Cancel the unread stream before throwing
166-
// so the underlying fetch connection is not held open waiting for the caller
167-
// to drain a payload we already decided to discard.
164+
// Release closes the dispatcher, so cancel its unread response body first.
168165
await response.body?.cancel().catch(() => undefined);
169166
throw new Error(`${params.failureLabel}: HTTP ${response.status}`);
170167
}

0 commit comments

Comments
 (0)