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 am trying to call a Firebase function to retrieve some data from within the launch request handler and it is failing with the message "There was a problem with the requested skills response." I have reproduced the error in a simple example that I can make available but thought I would start by including the relevant code below. I am using version 4.2.3 of the alexa-app library. Looking at the log I can see that it is tracking all the way through to the res.say function call but it doesn't appear to be returning. The CloudWatch logs show "Task timed out after X seconds." Bumping up the timeout has no effect.
constAlexa=require('alexa-app');constapp=newAlexa.app('test-alexa');constfirebase=require('./firebase.js');app.launch((req,res)=>{console.log('launch called');returnfirebase.database().ref('config').once('value').then((snapshot)=>{console.log('firebase returned');constvalue=snapshot.val();if(value){console.log('value is truthy');res.say('This is a test. By the way, the value was truthy.').reprompt('It really was!').shouldEndSession(false).send();}else{console.log('value is not truthy');res.say('This is a test. By the way, the value was falsey.').reprompt('It really was!').shouldEndSession(false).send();}});// return Promise.resolve().then(() => {// res.say('This is a test.').reprompt('It really is!').shouldEndSession(false).send();// });// return new Promise((resolve, reject) => {// setTimeout(() => {// resolve(res.say('This is a test!').reprompt('It really is!').shouldEndSession(false).send());// }, 2000);// });});
The text was updated successfully, but these errors were encountered:
The returned promise looks suspicious. Write a unit test for this, does it complete in the right order? I mean does the promise resolve after the say is called?
A quick follow-up on this. I wrote a unit test for this and have also tested it locally using the alexa-app-server and it works fine. Unfortunately, it stops working whenever I deploy it to AWS. I haven't completely gotten to the bottom of it yet but I think that your comment regarding the promise looking suspicious was on point. I say this because native promises are working fine for me; both locally and deployed. Because of the timeline I am working under I implemented a work-around by switching to the Firebase rest interface and avoiding the firebase admin SDK altogether.
I am trying to call a Firebase function to retrieve some data from within the launch request handler and it is failing with the message "There was a problem with the requested skills response." I have reproduced the error in a simple example that I can make available but thought I would start by including the relevant code below. I am using version 4.2.3 of the alexa-app library. Looking at the log I can see that it is tracking all the way through to the res.say function call but it doesn't appear to be returning. The CloudWatch logs show "Task timed out after X seconds." Bumping up the timeout has no effect.
The text was updated successfully, but these errors were encountered: