codeforequity-at / codeforequity-at/botium-core

Composite Slots throw Undefined Exception during tests

Open
#807 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
251
Forks
70
Avg merge
3h 37m
Merged PRs (30d)
7

Description

**Describe the bug**
I have been working on a Lex V2 project that is using [Composite Slots](https://docs.aws.amazon.com/lexv2/latest/dg/composite-slots.html) for a few Intents and we found that an undefined exception was interrupting the tests. We found that unfilled subslots were causing the exception when handling the response.

Regular slots get filtered out correctly as they are flat. For example:
```
"slots": {
"optInConfirmation": null,
}
```
Composite slots have nested subslots, so they are not filtered out:
```
"slots": {
"generalInquiry": {
"subSlots": {
"optType": null,
"optQuestion": null
},
"shape": "composite",
"value": {
"resolvedValues": []
}
}
}
```

**To Reproduce**
Create a composite slot for an intent and test

**Expected behavior**
The behavior should be the same as for simple slots

We have been able to correct the behavior by introducing Option chaining. I have opened a PR with our suggested fix. https://github.com/codeforequity-at/botium-connector-lex/pull/22

**Screenshots and Log files**
If applicable, add screenshots and/or logfiles to help explain your problem.
- [How to get logs from Botium Box](https://botium.atlassian.net/wiki/spaces/BOTIUM/pages/29360129/Enable+Diagnostics+and+Inspect+Logs)
- [How to get logs from Botium Bindings](https://botium.atlassian.net/wiki/spaces/BOTIUM/pages/426128/Troubleshooting)
- For Botium CLI, add the *--verbose* command line switch

**Botium Flavour:**
- Botium Box ?
- Botium CLI ?
- Botium Bindings ?

**Botium Version**
- Is there an exact version where this bug is happening ?

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.