@databricks/sdk-experimental (pinned by AppKit): SCIM v2 list() iterators never advance startIndex and never terminate
Les mainteneurs répondent en général sous 3 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- Une demi-journée
- Accessibilité débutants
- 42/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- javascript, typescript
- Domaine
- api
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- TypeScript
- Étoiles
- 119
- Forks
- 36
- Merge moyen
- 4 j 16 h
- PR mergées (30 j)
- 37
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire 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 databricks/appkit
-
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
databricks/appkit#729 ·
Les mainteneurs répondent en général sous 3 jours
-
@databricks/lakebase: pool drops maxLifetimeSeconds and other pg options, so connections never recycle and Unity Catalog claims access fails after 4 hoursPeut-être pris @billmcmillin l’a pris il y a 5 jours. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 20/100
databricks/appkit#718 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
databricks/appkit#699 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 4/5 3-5 jours Accessibilité débutants 28/100
databricks/appkit#648 · 2 commentaires ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 3/5 1-2 jours Accessibilité débutants 58/100
databricks/appkit#603 ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de databricks/appkit
Issues similaires
-
Add "append" and "prepend" slots for vue-vuetify extended renderersPeut-être pris @simeyc l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
eclipsesource/jsonforms#2668 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
README の通知条件を実際の判定処理に合わせるPeut-être pris @unhappychoice l’a pris aujourd’hui. Ouvertefactory:in-progress priority:medium
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
unhappychoice/oss-issue-opener#395 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug Website
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
OWASP/OWASP-Hunting#88 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour