BatchRequestContent breaks on Node20+
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- node.js, typescript
調査の方向性
Start with BatchRequestContent and reproduce the relative-URL case on Node 20 using the example in the issue. Trace how request URLs are constructed, including client.api(relativeUrl)'buildFullUrl' and the reported double-host behavior. Done means the documented batch-request pattern works with relative URLs without prepending the API host twice.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
While using older Node versions without undici fetch, we used the BatchRequestContent class of the Graph SDK to create batch requests. This operates on standard Request objects, but appears to use them mostly as URL containers, not actually sending those requests, because relative URLs are supported:
new BatchRequestContent([
{id: "1", request: new Request("/users/foo@domain.com")},
{id: "2", request: new Request("/users/bar@domain.com")}
]);
Since upgrading to Node 20 (way overdue, I know!), this pattern breaks, because the Request constructor does not support relative URLs:
TypeError: Failed to parse URL from users/foo@domain.com
at new Request (node:internal/deps/undici/undici:9580:19)
How is the BatchRequestContent class intended to be used on Node 20+? Couldn't the SDK define a BatchRequestContainer class that implements Request while merely functioning as an URL container, supporting the previous pattern of relative URLs? Or perhaps a static BatchRequestStep helper?
Or should clients have to manually extract the base URL of the API and prepend it to all batch request steps? What is the preferred way of doing so?
Rather than hard-coding it, I realized I could do client.api(relativeUrl)['buildFullUrl']() but this relies on a private method.
Edit: I realized that even if i DO supply a full URL, I will instead get an error Resource not found for the segment 'v1.0, supposedly because the API host will be prepended twice.
Expected behavior
BatchRequestContent should work with relative URLs on Node 20+
How to reproduce
Create a batch request content and pass one or more relative URLs like /users/foo
SDK Version
3.0.7
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- 主要言語
- TypeScript
- スター
- 833
- フォーク
- 240
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoftgraph/msgraph-sdk-javascript のほかの issue
-
status:waiting-for-triage
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
-
Is anyone here? オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · リアクション 1 件 ·
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests? オープンstatus:waiting-for-triage
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
-
status:waiting-for-triage type:bug
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · コメント 2 件 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
microsoftgraph/msgraph-sdk-javascript の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
check:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100