kevin-mitchell / alexa-app

Set of classes to make creating Amazon Alexa Skills Kit (ASK) applications easier with Laravel and Lumen
MIT License
97 stars 47 forks source link

Routing order does matter?! #25

Closed S43534 closed 7 years ago

S43534 commented 7 years ago

If I use routes for sessionEnded and intent and sessionEnded is after intent, it fails with a 404. If sessionEnded is on top, it works.

Sebastian

S43534 commented 7 years ago

To be a little more specific - for me only the last Alexa route works (no matter if intent or launch). Calling the routes before the last one result in a 404.

develpr commented 7 years ago

I was able to reproduce this issue last night. Frankly it seems pretty "broken" with this current issue, which leads me to believe something has changed with routing in 5.4 (or 5.3) that caused this.

I'm going to try to dig deeper tonight and will report back. In the meantime, if anybody else finds anything please feel free to let me know :)

develpr commented 7 years ago

FYI, @S43534 I've confirmed this bug is NOT present in 5.1.* - I'm looking into what's changed that's causing this issue, but FWIW (and I know this isn't a great solution!), if you use Laravel 5.1 (and possibly 5.2 or even 5.3, I haven't confirmed) then you should not have this issue.

develpr commented 7 years ago

OK, I figured this out I'm fairly certain. Looks like in Laravel 5.4 there was a getUri() method that changed to uri() - this was causing the alexa-app Route's getUri() to not be called, which at the end of the day was causing the routes to be overwritten in the collection. I'm going to fix this now and hopefully things should be good to go shortly!

develpr commented 7 years ago

@S43534 I believe this should be solved - can you take a look and confirm?

S43534 commented 7 years ago

Thanks very much @develpr - I can confirm it works with Laravel 5.4 without any issues now!