BatchRequestContent breaks on Node20+
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Calme
- Stack technique
- node.js, typescript
- Domaine
- api, backend-api-design
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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_
- Langage dominant
- TypeScript
- Étoiles
- 833
- Forks
- 240
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoftgraph/msgraph-sdk-javascript
-
status:waiting-for-triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 62/100
-
Is anyone here? Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 réaction ·
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests? Ouvertestatus:waiting-for-triage
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 42/100
-
status:waiting-for-triage type:bug
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 commentaires · 1 réaction ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
Toutes les issues de microsoftgraph/msgraph-sdk-javascript
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
copse-dev/agent-pane#2953 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Ouvertebug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Client support matrix inclusion Ouverteenhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
calcite-components needs triage refactor
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Esri/calcite-design-system#15203 ·