Fix a TypeError in the utility function getSupportedInterfaces.
Description
Fix a TypeError in getSupportedInterfaces utility function.
Add a test case to safeguard it from regressions.
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
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] Docs(Add new document content)
[ ] Translate Docs(Translate document content)
Checklist
[x] My code follows the code style of this project
[ ] My change requires a change to the documentation
Fix a
TypeError
in the utility functiongetSupportedInterfaces
.Description
Motivation and Context
This error occurs when calling
getSupportedInterfaces
withRequestEnvelopes
for certain types of requests that do not provide thedevice
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 thedevice
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