Request never resolves if URL is too long
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- typescript
- Domínio
- api
Direção de pesquisa
Begin at the client.api(...).get() and select(...) entry points shown in the reproduction, then trace URL construction and request error handling. Add a regression test with an oversized URL and repeated $select fields, and verify that the request settles by resolving or rejecting as expected.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the bug
I had a bug in my code that tried to request a massive url like https://graph.microsoft.com/v1.0/sites/$siteId/drive/root/delta?token=$token&$select=[...], which was 16,343 characters long, mainly in the $select query param. When calling await client.api(url).get(), it never resolves or rejects but hangs forever.
Expected behavior
The request should resolve or throw an error.
How to reproduce
Call await client.api('https://graph.microsoft.com/v1.0/sites/$siteId/drive/root/delta?token=$token&$select=$select').get() with a sufficiently large value for $select. Fields can be repeated in $select, in my example the select content.downloadUrl,id,webUrl,file,folder,name,lastModifiedDateTime,lastModifiedBy,createdDateTime,createdBy,size,cTag,eTag,parentReference,deleted was repeated over 100 times.
SDK Version
3.0.7
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
No response
Configuration
- MacOS Sequoia, Debian Bookworm
Does not appear to be specific to the configuration
Other information
The $select param should be deduplicated by the SDK. The way I ended up in this situation was I had code like this:
import {
Client,
} from "@microsoft/microsoft-graph-client";
async function example(client: Client) {
const siteId = "someid"
const select = ["content.downloadUrl", "id", /*etc*/]
const client: Client
let cursor = ""
while (true) {
if (!cursor) cursor = `/site/${siteId}/drive/root/delta`
const response = await client.get(cursor).select(select).get()
cursor = response['@odata.nextLink']
// Process data in response
if (!cursor) break
}
}
Eventually the select param gets so large that it causes this error
- Linguagem predominante
- TypeScript
- Estrelas
- 833
- Forks
- 240
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoftgraph/msgraph-sdk-javascript
-
status:waiting-for-triage
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 62/100
-
Is anyone here? Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 reação ·
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests? Abertastatus:waiting-for-triage
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 42/100
-
status:waiting-for-triage type:bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 comentários · 1 reação ·
-
status:waiting-for-triage type:bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
Todas as issues de microsoftgraph/msgraph-sdk-javascript
Issues semelhantes
-
comp/desktop P3 type/bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
NousResearch/hermes-agent#118866 ·
-
Browser Waiting for: Product Owner
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
getsentry/sentry-javascript#24577 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
agilepathway/label-checker#640 ·
-
Plugin stuck at "loading" on DSH 0.1.6-alpha.2 — turnTail list slot registration missing options.id Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
Add 2021 Cup data to website Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
chrisparsons83/flexspotff#153 ·