Request never resolves if URL is too long
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript
- 领域
- api
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- TypeScript
- 星标
- 833
- 派生
- 240
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 个 reaction ·
-
status:waiting-for-triage
难度 5/5 一周以上 新手友好度 42/100
-
status:waiting-for-triage type:bug
难度 3/5 1-2 天 新手友好度 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 条评论 · 1 个 reaction ·
-
status:waiting-for-triage type:bug
难度 4/5 3-5 天 新手友好度 45/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