alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.12k stars 735 forks source link

fix(ask-sdk-core): type error in util #710

Closed igilham closed 2 years ago

igilham commented 2 years ago

Fix a TypeError in the utility function getSupportedInterfaces.

Description

Motivation and Context

This error occurs when calling getSupportedInterfaces with RequestEnvelopes for certain types of requests that do not provide the device property in the system context.

Fixes #709

Testing

Added a new unit test case calling the function with a mock RequestEnvelope which does not define the device property. In the existing code, the error is thrown. The behaviour in this patch is to return an empty object instead. This complies with the function's existing type signature so effects on clients should be minimal.

Types of changes

Checklist

License

igilham commented 2 years ago

Oops, that got closed as a result of a work-around PR in a private repository.