Alexa Progressive Response causes error when using Jovo Debugger


#1

I have a skill that uses an Alexa Progressive Response while waiting to play an audio file. If I run the skill in the Jovo debugger I get the following error:

Error -----------------------------------------------------------------
  
  Code:
  ERROR
  
  Message:
  connect ECONNREFUSED 127.0.0.1:80
  
  Stack:
  Error: connect ECONNREFUSED 127.0.0.1:80
      at Function.progressiveResponse (/Users/bhartman/Development/jovo/FiveByFive/node_modules/jovo-platform-alexa/src/services/AlexaAPI.ts:73:13)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
  
   ----------------------------------------------------------------------
  
  
  Request details:
  this.$alexaSkill initialized
  this.$type: {"type":"INTENT"}
  this.$session.$data : {"personIdx":0}
  this.$nlu : {"intent":{"name":"YesIntent"}}
  this.$inputs : {}
  
  
   ----------------------------------------------------------------------
  
  unhandledRejection
  {}
  Error: Request failed with status code 500
      at createError (/Users/bhartman/Development/jovo/FiveByFive/node_modules/axios/lib/core/createError.js:16:15)
      at settle (/Users/bhartman/Development/jovo/FiveByFive/node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (/Users/bhartman/Development/jovo/FiveByFive/node_modules/axios/lib/adapters/http.js:236:11)
      at IncomingMessage.emit (events.js:215:7)
      at IncomingMessage.EventEmitter.emit (domain.js:476:20)
      at endReadableNT (_stream_readable.js:1183:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

If I use the Alexa Developer test simulator, the progressive response works fine. However, I’d like to be able to use the Jovo debugger since I am using the audio player.


#2

Hi @Ben_Hartman, thanks for flagging!

That’s true. Since the Jovo Debugger is using sample JSON requests, the Alexa API endpoint for the progressive responses won’t work. We should definitely have a better way of handling this though. cc @AlexSwe


#3

The progressiveResponse API call needs the api access token which comes with every Alexa request. It’s a token that can’t be generated by the framework nor the webhook or debugger.

I think a helper like this.isJovoDebuggerRequest() would make it easier to bypass API calls that are not available with the JovoDebugger.

if (this.isJovoDebuggerRequest()) {
  this.ask(...);
} else {
  this.progressiveResponse(...)
}

What do you think?


#4

Hi @AlexSwe - yes, this would work for me, but I’m concerned about other users that potentially would hit the same problem and not know about this problem/solution. Is there any way (that’s reasonable) to handle the error down at the node_module level rather than put the responsibility on the user? If not, I can certainly implement your proposed solution and just wrap all my progressiveResponse calls in (if this.isAlexaSkill() && !this.isJovoDebuggerRequest()) checks. I’d also recommend saying something about it in the progressiveResponse section of the Jovo documentation. As developers, we love writing documentation, right? :wink:


#5

Good point. I updated the progressiveResponse method.
The API won’t be called in JovoDebugger requests and a warning will be shown.

It will be available with the next release.


#6

:+1: Thanks @AlexSwe