Comments (12)
Thanks @pwbrown, do you think you can write a test that reproduces this? I think it got broken because we don't correctly cover this scenario. /cc: @fremail.
from alexa-app.
@pwbrown are you testing your app with real requests?
Amazon writes that all requests must contain context: link
from alexa-app.
Thanks @fremail I'll test with real requests in a bit. Either way alexa-app-server no longer works with latest in alexa-app on github and should probably be updated with the proper request JSON structure.
from alexa-app.
Oh, I just updated to the master and got an error for launch request (from Amazon Alexa Simulator):
TypeError: Cannot read property 'application' of undefined
I send a request JSON with context
, but get event
object w/o context
object at all (in alexa.handler).
from alexa-app.
I just tested with the Alexa simulator and got a similar result. Looks like it's on Amazon this time for not updating or not sending their full structure in the simulator request. Tested the Alexa start structure that is prebuilt for testing Lambda functions and looks like they updated it to include the context structure so it ended up working. Also tested it on the device itself and it worked fine. I think in terms of this bug, it is probably resolved although I would say it could be adjusted so it doesn't hard fail in this circumstance, but that it gives a helpful error message. As for now I will start writing a pull request to update the request structure for alexa-app-server since that is the main local testing tool I use. Thanks @fremail for the quick feedback.
from alexa-app.
Got the same error even on a real request :(
from alexa-app.
Then we can't get userId
and applicationId
if the request w/o session
.
Don't understand how we should check applicationId
in that case.
I can leave userId
and applicationId
empty in case of request doesn't have session
. But I don't like that solution.
@dblock maybe you have alternative ideas?
from alexa-app.
Just added this pull request for alexa-app-server so hopefully that problem will be resolved soon.
from alexa-app.
Sifting through documentation for Alexa it seems that Amazon is very unclear about what is included in requests across the board. AudioPlayer is very clear that the session object is not included and that the userId and applicationId is clearly found in the context object, but other pages either show the context object present along with the session object in standard requests or they aren't. Why don't you just attempt to retrieve the userId and applicationId from context, and if that fails see if there is a session object that can be searched, and if that fails then don't include it. From the documentation it seems that all requests will have one or the other or both in all cases(context or session object).
from alexa-app.
I agree.
I'll fix that
from alexa-app.
I think for applicationId
and such we should return null
when there's no session.
from alexa-app.
I'm closing this via #100 and #101, @pwbrown would you be able to test against HEAD? Definitely want before releasing 2.4.0 (#103).
from alexa-app.
Related Issues (20)
- Support for CanFulfillIntentRequest HOT 7
- Errors when using KeepAlive-style CloudWatch events HOT 5
- Patch for directive Dialog.Delegate HOT 2
- Cannot get directive display to work in Alexa skill. HOT 5
- Not able to use alexa-app HOT 2
- APL Support ? HOT 6
- VideoApp Directive HOT 1
- alexa-verifier-middleware HOT 1
- request.userId returning the wrong user HOT 3
- Multi turn dialog
- How we can get user permissions list?
- ssml lowercase
- Firebase Promise Failure HOT 2
- Support for In-Skill Purchases (ISP)? HOT 1
- INVALID_REQUEST_TYPE HOT 3
- Chained callbacks not working. HOT 2
- Issues testing locally the Skill: alexa-app + express + ngrok HOT 2
- Xxxxx
- REPLACE_ALL play behavior has no effect HOT 1
- Catch User Profile Data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alexa-app.