Skip to content

Randomly rejected promise #721

@stianl

Description

@stianl

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)
])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions