alexa-samples / skill-sample-nodejs-audio-player

An Alexa Skill Sample showing how to play long form audio in 3P-skills
Other
470 stars 318 forks source link

States Not Working Properly #14

Closed rsokz closed 6 years ago

rsokz commented 7 years ago

After entering the State for "PLAY_MODE", it seems to be impossible to leave it. If I take care of an intent inside "PLAY_MODE" and change the state the following way:

this.handler.state = constants.states.START_MODE;

The follow up intent will still not recognize that is it in "START_MODE" and will still be in "PLAY_MODE". Anybody else experiencing this?

waiwong614 commented 7 years ago

Hi, Were you able to solve this problem? I'm having the same issues.

Thanks

uscitp-rsokolov commented 7 years ago

@waiwong614 One way to accomplish this is by doing something like this:

stateHandlers.startModeIntentHandlers.InitialIntent.call(this);

You can replace the 'InitialIntent' with any other intent you'd like to call.

TribalTony commented 7 years ago

Having the same issue. Seem to be able to set other states but cannot set state to an empty string.

Ole73 commented 6 years ago

Got the same problem and after a deeper look, i focused that START_MODE is unnamed in constants.js what causes dynamoDb not being able to save the state. When I named START_MODE like '_START_MODE', to get a hook to return back on it, i got no more entry point into the whole skill. So I let START_MODE unnamed and added a new, named state like STARTOVER_MODE, where I could return back into. But I also didn't understand the whole logic behind this behaviour at all. Some more doc about diffs between named and unnamed states and entry points would be very welcome!

I also don't understand the logic behind calling this.handler.state = constants.states.START_MODE; in stateHandlers.js -> line 21, when we are already in this state..

sebsto commented 6 years ago

ASK NodeJS SDK has been updated with improved documentation.
https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs#skill-state-management

I am closing this thread as it does not appear to be a problem with the code sample, but general programming questions.