alexa-skills-kit-sdk-for-nodejs
alexa-skills-kit-sdk-for-nodejs copied to clipboard
interfaces.alexa.presentation.apl.GoBackCommand does not work
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:
The current definition of the interfaces.alexa.presentation.apl.GoBackCommand (from the alexa-apis-for-nodejs repo) does not work.
- It enforces the
typevalue to beGoBackbut all of the backstack documentation suggests it should beBack:GoBack - It enforces the
backValueproperty to be a string but when thebackTypeiscountorindexit should be a number.
Expected Behavior
- Developers should be able to successfully build a command for the
ExecuteCommandsdirective that returns the user to the previous screen via the backstack without needing to hack the typescript.
Current Behavior
- Developers following the typescript structure build a command that does not successfully execute
- In order for developers to successfully execute the back command they have to hack around the typescript
Possible Solution
- The alexa-apis-for-nodejs repo where the type is defined suggests it is auto-genned from the documentation. The applicable documentation should be updated and the repo regenerated to update the type definition.
Steps to Reproduce (for bugs)
- Implement two APL pages that extend the backstack extension
- On the second page, trigger a
SendEventcommand - From the skill, receive the
SendEventcommand and return a response with anExecuteCommandsdirective- Include the Back command as currently specified in the ask-sdk-model
- Run the code and see the the command does not successfully execute (fails silently).
- Update the Back command to match the context below (hacking the typescript as necessary)
- Rerun the code and see the command now successfully returns the user to the first APL doc.
Context
We are having to hack our typescript with as unknown as Command in order to allow the successful definition to be used.
return {
type: 'Alexa.Presentation.APL.ExecuteCommands',
commands: [{
type: 'Back:GoBack',
backType: 'count',
backValue: 1,
} as unknown as Command], //
token
}
This leaves us unprotected from future changes and updates.
Your Environment
- ASK SDK for Node.js used: 2.14.0
- ASK SDK Model: 1.86.0
Node.js Info
- Node.js version used for development: 18.x