@databricks/sdk-experimental (pinned by AppKit): SCIM v2 list() iterators never advance startIndex and never terminate
維護者通常 3 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 半天
- 新手友好度
- 42/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- javascript, typescript
- 領域
- api
研究方向
The bug is in the shipped dist/apis/iam/api.js of @databricks/sdk-experimental, in the async *list generators of the six SCIM V2 services (for example ServicePrincipalsV2Service). Read that loop first: request never changes, so startIndex never advances. Done means each generator adds the page length to startIndex and stops on an empty page, verified with a mocked SCIM response. The source likely lives in the upstream SDK repo, not this one, so confirm where to make the change first.
由索引模型根據 Issue 內容生成。
描述
Summary
The six SCIM v2 list() async iterators in @databricks/sdk-experimental request the same page on every pass. When the result is not empty they yield the first page again and again and never finish.
AppKit pins @databricks/sdk-experimental 0.17.0 and gives apps its WorkspaceClient, so an AppKit app that iterates users, groups or service principals this way hangs and keeps calling the SCIM API.
I am filing this here because the SDK's own tracker (the bugs.url in its package.json, github.com/databricks/databricks-sdk-js/issues) is not publicly reachable. Please move it if there is a better place.
Affected
@databricks/sdk-experimental0.17.0 and 0.18.0 (the latest), indist/apis/iam/api.js.- Workspace client:
usersV2.list,groupsV2.list,servicePrincipalsV2.list. - Account client:
accountUsersV2.list,accountGroupsV2.list,accountServicePrincipalsV2.list.
I checked every async iterator in 0.18.0 (127): these six are the only ones that loop on an unchanged request.
Code as shipped (0.18.0, ServicePrincipalsV2Service)
async *list(request, context) {
while (true) {
const response = await this._list(request, context);
if (context?.cancellationToken &&
context?.cancellationToken.isCancellationRequested) {
break;
}
if (!response.Resources || response.Resources.length === 0) {
break;
}
for (const v of response.Resources) {
yield v;
}
}
}
request is never changed, so startIndex stays where the caller set it. The loop ends only on an empty page, and a first page that has items never becomes empty.
Reproduce
On any workspace that has at least one service principal:
import {WorkspaceClient} from "@databricks/sdk-experimental";
const w = new WorkspaceClient({});
let n = 0;
for await (const sp of w.servicePrincipalsV2.list({})) {
n++;
if (n > 10_000) throw new Error("still iterating"); // always reached
}
The same items come back in the same order on every pass.
Expected
After each page, add the number of items returned to startIndex and stop on an empty page. The modular SDK already does this in databricks/sdk-js, packages/scim/src/v1/client.ts:
pageReq.startIndex = (resp.startIndex ?? 0n) + BigInt(items.length);
Workaround
Page explicitly: call the SCIM list endpoint with startIndex and count, and add each page's length to startIndex until a page comes back empty.
- 主要語言
- TypeScript
- 星號
- 119
- 分支
- 36
- 平均合併
- 4 天 16 小時
- 30 天內合併 PR
- 37
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
databricks/appkit 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 55/100
databricks/appkit#729 ·
維護者通常 3 天內回覆
-
@databricks/lakebase: pool drops maxLifetimeSeconds and other pg options, so connections never recycle and Unity Catalog claims access fails after 4 hours可能已有人在做 @billmcmillin 於 5 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 20/100
databricks/appkit#718 ·
維護者通常 3 天內回覆
-
難度 4/5 3-5 天 新手友好度 48/100
databricks/appkit#699 ·
維護者通常 3 天內回覆
-
難度 4/5 3-5 天 新手友好度 28/100
databricks/appkit#648 · 2 則留言 ·
維護者通常 3 天內回覆
-
難度 3/5 1-2 天 新手友好度 58/100
databricks/appkit#603 ·
維護者通常 3 天內回覆
查看 databricks/appkit 的全部 Issue
相似的 Issue
-
Add "append" and "prepend" slots for vue-vuetify extended renderers可能已有人在做 @simeyc 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
eclipsesource/jsonforms#2668 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
README の通知条件を実際の判定処理に合わせる可能已有人在做 @unhappychoice 今天認領。 未關閉factory:in-progress priority:medium
難度 1/5 1 小時以內 新手友好度 90/100
unhappychoice/oss-issue-opener#395 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug Website
難度 2/5 1-3 小時 新手友好度 77/100
OWASP/OWASP-Hunting#88 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆