Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear alexa session attributes on InOneGoMusicPlayback intent and new session #259

Closed
hyzhak opened this issue Apr 29, 2018 · 0 comments
Closed
Assignees
Labels
alexa Support Amazon Alexa platform enhancement New feature or request high priority high priority

Comments

@hyzhak
Copy link
Member

hyzhak commented Apr 29, 2018

Unlike google action, Alexa skill doesn't have a long running session, which ends with song playback.
But sure, we still need to remember user's dialog context even on song's playback. So we use persistent attributes here.
But we face another problem - we should clear manually psedo-session data.

  • we does it for request.type == 'LaunchRequest'
  • but we can't catch complex wake up calls like:

Alexa, ask internet archive to play jazz

because from we receive request similar to which we would get in the middle of discussion:

[USER] 78s
[USER] play jazz

except flag session: true:

{
	"version": "1.0",
	"session": {
		"new": true,
		"sessionId": "...",
		"application": {
			"applicationId": "...."
		},
		"user": {
			"userId": "...."
		}
	},
	"context": {
		"AudioPlayer": {
			"playerActivity": "IDLE"
		},
		"Display": {},
		"System": {
			"application": {
				"applicationId": "..."
			},
			"user": {
				"userId": "...."
			},
			"device": {
				"deviceId": "....",
				"supportedInterfaces": {
					"AudioPlayer": {},
					"Display": {
						"templateVersion": "1.0",
						"markupVersion": "1.0"
					}
				}
			},
			"apiEndpoint": "https://api.amazonalexa.com",
			"apiAccessToken": "...."
		}
	},
	"request": {
		"type": "LaunchRequest",
		"requestId": ".....",
		"timestamp": "2018-04-29T21:14:39Z",
		"locale": "en-US",
		"shouldLinkResultBeReturned": false
	}
}

so maybe we should use this flag and clear context data when think that we faced "new session".
Which actually will be "new" in dialog like:

[playing blues of 78s]
[USER] stop
[USER] play jazz

it is very likely that user means: play jazz of 78s.
but we would get new session and request of play jazz and sure forget about 78s and blues.

Ideas:

  • Could state machine be useful here?
  • set attributes['playbackFinished'] = true in PlaybackFinished intent
@hyzhak hyzhak added enhancement New feature or request high priority high priority alexa Support Amazon Alexa platform labels Apr 29, 2018
@hyzhak hyzhak added this to the Integrate both platforms milestone Apr 29, 2018
@hyzhak hyzhak self-assigned this Apr 29, 2018
@hyzhak hyzhak changed the title clear alexa session attributes on InOneGoMusicPlayback intent clear alexa session attributes on InOneGoMusicPlayback intent and new session May 2, 2018
@hyzhak hyzhak closed this as completed May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alexa Support Amazon Alexa platform enhancement New feature or request high priority high priority
Projects
None yet
Development

No branches or pull requests

1 participant