Giter VIP home page Giter VIP logo

Comments (12)

dblock avatar dblock commented on July 16, 2024

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.

fremail avatar fremail commented on July 16, 2024

@pwbrown are you testing your app with real requests?
Amazon writes that all requests must contain context: link

from alexa-app.

pwbrown avatar pwbrown commented on July 16, 2024

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.

fremail avatar fremail commented on July 16, 2024

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.

pwbrown avatar pwbrown commented on July 16, 2024

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.

fremail avatar fremail commented on July 16, 2024

Got the same error even on a real request :(

from alexa-app.

fremail avatar fremail commented on July 16, 2024

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.

pwbrown avatar pwbrown commented on July 16, 2024

Just added this pull request for alexa-app-server so hopefully that problem will be resolved soon.

from alexa-app.

pwbrown avatar pwbrown commented on July 16, 2024

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.

fremail avatar fremail commented on July 16, 2024

I agree.

I'll fix that

from alexa-app.

dblock avatar dblock commented on July 16, 2024

I think for applicationId and such we should return null when there's no session.

from alexa-app.

dblock avatar dblock commented on July 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.