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

Request timeout does not cover stalled response bodies

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
typescript
領域
api

調査の方向性

src/core.ts:564-568 から始めて、fetchWithTimeout がタイマーを消去する箇所を追跡し、続いて src/core.ts:70-91 の defaultParseResponse() と、README.md:135-154 および src/index.ts:62-69 のタイムアウト契約を読みます。付属の応答停止の再現を実行し、リクエストが保留されたままにならず、設定されたタイムアウトの前後で APIConnectionTimeoutError により拒否されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Description

The documented request timeout only lasts until fetch() resolves with response headers; it does not cover reading/parsing the response body.

fetchWithTimeout() clears its timer in src/core.ts:564-568 as soon as the fetch promise settles. defaultParseResponse() reads response.json()/response.text() later (src/core.ts:70-91) with no active timer. A server that sends headers and then stalls can therefore leave the SDK promise pending indefinitely, despite README.md stating that requests time out and throw APIConnectionTimeoutError.

Reproduction
import http from 'node:http';
import Browserbase from '@browserbasehq/sdk';

const server = http.createServer((_req, res) => {
  res.writeHead(200, { 'content-type': 'application/json' });
  res.write('{'); // send headers and a partial body, then stall
});
await new Promise<void>((resolve) => server.listen(0, '127.0.0.1', resolve));

const address = server.address();
if (!address || typeof address === 'string') throw new Error('missing port');

const client = new Browserbase({
  apiKey: 'test',
  baseURL: `http://127.0.0.1:${address.port}`,
  timeout: 50,
  maxRetries: 0,
});

const result = await Promise.race([
  client.get('/stall').then(
    () => 'resolved',
    (error) => error.constructor.name,
  ),
  new Promise<string>((resolve) => setTimeout(() => resolve('still pending'), 250)),
]);

console.log(result); // still pending, not APIConnectionTimeoutError
server.closeAllConnections();
server.close();
Expected behavior

The request rejects with APIConnectionTimeoutError around 50 ms, including time spent receiving/parsing the body.

Actual behavior

The request remains pending after 250 ms and can hang indefinitely.

Why this matters

A partial or slow response defeats the SDK's primary bound on request duration. This can exhaust application concurrency and contradicts the timeout contract documented in README.md:135-154 and ClientOptions in src/index.ts:62-69.

Tested with Node 22.14.0 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 を短くまとめたダイジェスト。