Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomly rejected promise #721

Open
stianl opened this issue Dec 9, 2021 · 1 comment
Open

Randomly rejected promise #721

stianl opened this issue Dec 9, 2021 · 1 comment

Comments

@stianl
Copy link

stianl commented Dec 9, 2021

Using Promise.all with apiKeyMode does not seem to work properly - one of the promises is always rejected.
This used to work fine when using client.loginWithApiKey() in earlier versions of the SDK.

const client = new CogniteClient({
  appId: 'Cognite SDK samples',
  project,
  getToken: () => Promise.resolve(apiKey),
  apiKeyMode: true
});

const [eventCount, fileCount] = await Promise.all([
  client.events.aggregate.count(filter),
  client.files.aggregate(filter)
])
@pedroharbs
Copy link
Contributor

Hey @stianl I've been testing this situation at the version 6.1.1 and the use of Promise.all with this functions work perfectly without any problems. You can pass the version that you are trying to implement this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants