jovotech / jovo-framework

🔈 The React for Voice and Chat: Build Apps for Alexa, Messenger, Instagram, the Web, and more
https://www.jovo.tech
Apache License 2.0
1.67k stars 310 forks source link

Progressive Response for a longer time #550

Closed sebastianbrunnert closed 5 years ago

sebastianbrunnert commented 5 years ago

Support searched

` async ProgressiveResponseWithCallback() { this.$alexaSkill.progressiveResponse('Processing your request', () => { setTimeout( () => { this.alexaSkill().progressiveResponse('Still processing'); }, 1500); }); await dummyApiCall(8000);

    this.tell('Text after API call');
}

`

If i wait 2000 ms everything works fine, but my api request is large. Is there a way to increase the time, the program waits? I get this log:

"request": { "type": "SessionEndedRequest", "requestId": "amzn1.echo-api.request.10b19d0a-9986-457c-8f91-2ade7120d0de", "timestamp": "2019-07-31T17:10:19Z", "locale": "de-DE", "reason": "ERROR", "error": { "type": "INVALID_RESPONSE", "message": "SpeechletResponse was null" } }

But its confusing because after the api loaded succesfully, i get a message that the text (that should be sended) is sent...

Thanks for your help and for making this awesome framework :)

Your Environment

KaanKC commented 5 years ago

No, you can't.

Here's the relevant snippet from the Amazon docs:

Progressive responses do not change the overall time allowed for a response. When a user invokes a skill, the skill has approximately 8 seconds to return a full response. The skill must finish processing any progressive responses as well as the full response within this time.

https://developer.amazon.com/docs/custom-skills/send-the-user-a-progressive-response.html

The message you see is the framework logging the response it tries to send to Amazon after your API call is done. If the response is sent to late tho, it won't be accepted anymore and you receive the error.

sebastianbrunnert commented 5 years ago

Thanks for your answer. But is there any way to get more time? The API cant be faster..

sebastianbrunnert commented 5 years ago

I found a way to make the API more faster. Thanks for your answer :)