Retryable responses are abandoned without canceling their bodies
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- node.js, typescript
- 領域
- api
調査の方向性
src/core.ts:490-495 の retry ブランチから開始し、提供された再現手順を実行して、キャンセルされていないレスポンスボディを確認します。retryRequest() の前にランタイム互換のクリーンアップを追加し、その後、Web と Node の両方のストリーム実装でキャンセルをテストして、最初のレスポンスが retry の前にキャンセルされることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Description
When an HTTP response is retryable, the SDK starts the next attempt without consuming or canceling the previous response body.
The early return at src/core.ts:490-495 bypasses response.text() and does not call response.body.cancel() (or the runtime-equivalent cleanup) before retryRequest().
Reproduction
import Browserbase from '@browserbasehq/sdk';
let attempts = 0;
let cancelCalls = 0;
const client = new Browserbase({
apiKey: 'test',
maxRetries: 1,
fetch: async () => {
attempts++;
if (attempts === 1) {
const body = new ReadableStream({
cancel() {
cancelCalls++;
},
});
return new Response(body, {
status: 500,
headers: { 'content-type': 'text/plain' },
});
}
return new Response('{}', {
status: 200,
headers: { 'content-type': 'application/json' },
});
},
});
await client.get('/retry');
console.log(cancelCalls); // 0
Expected behavior
The unused body of the first response is canceled before retrying (cancelCalls === 1).
Actual behavior
The response is abandoned without cancellation (cancelCalls === 0).
Why this matters
With streaming or large error responses, abandoning the body can keep sockets and stream resources occupied, reduce connection reuse, and accumulate resources across repeated 429/5xx responses. The retry branch should explicitly cancel the body in a runtime-compatible way and test both Web and Node stream implementations.
Tested against @browserbasehq/sdk 2.18.0 / current main (b781bd7).
- 主要言語
- TypeScript
- スター
- 64
- フォーク
- 17
- 平均マージ
- 13分
- マージ済み PR(30日)
- 4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
browserbase/sdk-node のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
browserbase/sdk-node#202 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
browserbase/sdk-node#197 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
browserbase/sdk-node#193 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
browserbase/sdk-node#180 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 66/100
browserbase/sdk-node#218 · コメント 2 件 ·
browserbase/sdk-node の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mksglu/context-mode#1200 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anthropics/claude-code#96687 ·
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
AOSSIE-Org/DebateAI#582 · コメント 2 件 ·