jovotech / jovo-framework

🔈 The React for Voice and Chat: Build Apps for Alexa, Messenger, Instagram, the Web, and more
https://www.jovo.tech
Apache License 2.0
1.67k stars 309 forks source link

Alexa Device Address issue #441

Closed natrixx closed 5 years ago

natrixx commented 5 years ago

I'm submitting a...

Expected Behavior

If I revoke address permission in my alexa app for my skill, when I make a request I should get error.code === 'NO_USER_PERMISSION' as per https://www.jovo.tech/docs/amazon-alexa/data#location

Current Behavior

I am instead getting error.code === 'ACCESS_DENIED' as seen below. This results in not being able to send the permissions card to the user.

Error log

AlexaAPIResponse {
  httpStatus: 403,
  data: 
   { code: 'ACCESS_DENIED',
     message: 'Access denied with reason: ACCESS_NOT_REQUESTED' } }
{ Error: Access denied with reason: ACCESS_NOT_REQUESTED
    at Function.deviceAddressApi (/mibluerepo/node_modules/jovo-platform-alexa/src/services/AlexaDeviceAddress.ts:36:18)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7) code: 'ACCESS_DENIED' }

Your Environment

Jovo packages of current project: jovo-cms-i18next: 2.1.5 jovo-core: 2.1.3 jovo-db-dynamodb: 2.1.5 jovo-db-filedb: 2.1.3 jovo-framework: 2.1.5 jovo-platform-alexa: 2.1.6 jovo-platform-dialogflow: 2.1.5 jovo-platform-googleassistant: 2.1.7 jovo-plugin-debugger: 2.1.3

aswetlow commented 5 years ago

Hey @natrixx Thanks for the finding. Seems like they changed the API error codes again. Will be fixed until Monday!

subhashnaidu commented 5 years ago

I am having a similar issue with getting the device address from Alexa. The object that is returned contains null values for the address and only contains the country and postal code, even though I request the full device address. I am testing this via the Alexa app on the phone with the permissions for the full address turned on. Image2

aswetlow commented 5 years ago

@natrixx Fixed! We will make the release (with a few more changes) later this week.

@subhashnaidu You probably accessing the CountryAndPostalCode only. Try const address = await this.$alexaSkill.$user.getDeviceAddress(); to get the full address.

natrixx commented 5 years ago

updated and tested today, seems to be fixed. Thanks @aswetlow !

aswetlow commented 5 years ago

You're welcome :)