You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a test that has 4 different cases. The 4th (and periodically the 3rd) fails with the following error:
Uncaught ReferenceError: run_once is not defined
at Request._callback (node_modules/auth0-rules-testharness/index.js:69:20)
at Request.self.callback (node_modules/request/request.js:188:22)
at Request.<anonymous> (node_modules/request/request.js:1171:10)
at IncomingMessage.<anonymous> (node_modules/request/request.js:1091:12)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
This looks like the webtask request is failing with a 429. In this scenario its supposed to set a timer and retry. However the callback "run_once" is not defined.
I fixed this locally, by something like:
if (res.statusCode === 429) {
var backoff = (+res.headers['retry-after'] || 5) * 1000;
backoff += Math.floor(Math.random() * backoff);
winston.debug('scheduling retry of auth0-sandbox request', {
backoff: backoff
});
var run_once = function() {
request(options, function (err, res, body) {
if (err) {
if (typeof err === 'object' && (err.code === 'ETIMEDOUT' || err.code === 'ESOCKETTIMEDOUT')) {
return callback(new Error(params.timeout));
}
return callback(err);
}
process_result(res, body)
})
}
setTimeout(run_once, backoff);
return;
}
process_result(res, body)
function process_result(res, body) {
// Previous process flow from here...
if (res.statusCode !== 200 && res.statusCode !== 500) {
var errorMessage = 'Invalid response code from the auth0-sandbox: HTTP ' + res.statusCode + '.';
var parsedBody = toJSON(body);
...
The text was updated successfully, but these errors were encountered:
I have a test that has 4 different cases. The 4th (and periodically the 3rd) fails with the following error:
This looks like the webtask request is failing with a 429. In this scenario its supposed to set a timer and retry. However the callback "run_once" is not defined.
I fixed this locally, by something like:
The text was updated successfully, but these errors were encountered: