domoinc / domo-node-sdk

NodeJS - Domo API SDK
https://developer.domo.com
MIT License
25 stars 11 forks source link

Creating stream execution with invalid credentials causes infinite loop #12

Open Baugs opened 6 years ago

Baugs commented 6 years ago

The following code produces an infinite loop:

const domo = require('domo-sdk');
const domoClient = new domo.DomoClient('foo', 'bar');
domoClient.streams.createExecution('19').then((res) => {
        // Never gets here
        done();
      }).catch((err) => {
        // Never gets here either
        done(err);
      });

The logs will print the following: GET: https://api.domo.com/oauth/token OAuth token has likely expired. Renewing and attempting again Renewing access token for scopes: "user data"

walexnelson commented 6 years ago

Looks like the logic to limit retries was missed

https://github.com/domoinc/domo-node-sdk/blob/master/src/common/Transport.ts#L129