alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.12k stars 735 forks source link

addDelegateDirective not supported #708

Closed ciddypoo closed 2 years ago

ciddypoo commented 2 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ x] Other... Please describe:

Expected Behavior

I'm using the addDelegateDirective to chain two intents at the start of a skill, in order to customize the skill responses towards the user's preferred results.

Current Behavior

Strangely, while this works on the development version of my Alexa skill, on the live version I'm getting "The following directives are not supported: Dialog.Delegate". Additionally, if you use the Browser Test Environment in the development console, there are no problems. However, if you use the live skill on a hub or cellphone, the error appears.

Steps to Reproduce (for bugs)

const LaunchRequestHandler = {
    canHandle(handler) {
        return handler.requestEnvelope.request.type === 'LaunchRequest';
    },
    async handle(handler) {
        const attributes = await handler.attributesManager.getPersistentAttributes();
        return handler.responseBuilder
        .addDelegateDirective({
            name: 'PreSelectionIntent',
            confirmationStatus: 'NONE',
            slots: {
                skilift: {
                    name: 'skilift',
                    confirmationStatus: 'NONE',
                    type: 'yesNoType',
                    source: 'USER'
                 },
                 rental: {
                    name: 'rental',
                    confirmationStatus: 'NONE',
                    type: 'yesNoType',
                    source: 'USER'
                 },
                 forchildren: {
                    name: 'forchildren',
                    confirmationStatus: 'NONE',
                    type: 'yesNoType',
                    source: 'USER'
                 }               
            }
        })
        .speak(handler.t('WELCOME'))
        .getResponse();   
    },
};

Context

The error blindsided me since I did not get it on any of my devices during development, until new users started reporting the problem when the skill went live. The only way to reproduce it I found is to start the skill via Alexa App on my phone and pick my Echo device as output.

Your Environment

"ask-sdk": "^2.11.0",

Node.js version used for development: 16.10.0 NPM version used for development: 7.24.0