Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Retryable responses are abandoned without canceling their bodies

オープン
#204 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

browserbase/sdk-node のほかの issue

browserbase/sdk-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。