`Unhandled` and `@PrioritizedOverUnhandled` handlers don't clean up the state stack correctly
See original GitHub issueI’m submitting a…
- Bug report
- Feature request
- Documentation issue or request
- Other… Please describe:
Expected Behavior
I’ll use @PrioritizedOverUnhandled
as the example here, but I believe this issue applies more generally when delegated components aren’t explicitly resolved.
If I have a handler with the @PrioritizedOverUnhandled()
decorator for a specific intent and its called, the state stack is left in a way that breaks the $resolve
behaviour.
See the reproduction here.
Current Behavior
I did this interaction through the debugger:
And saw this in the state stack. It did not find the handler in the GlobalComponent
via the resolve
call in LoveHatePizzaComponent
>>>>> Request - 2022-02-01T00:53:32.267Z
{
"version": "4.0",
"platform": "jovo-debugger",
"id": "d79b0a70-3c4d-4efd-947e-6cae966b51cc",
"timestamp": "2022-02-01T00:53:31.979Z",
"timeZone": "Australia/Brisbane",
"locale": "en",
"input": {
"intent": "NoGoodIntent",
"type": "INTENT"
},
"context": {
"device": {
"id": "b019fe87-cae7-4f79-a5cb-fb6e38e0fe29",
"capabilities": [
"SCREEN",
"AUDIO"
]
},
"session": {
"id": "0bf34a99-531a-4969-b694-e26eaaf6849f",
"data": {},
"state": [
{
"component": "GlobalComponent"
},
{
"resolve": {
"fail": "Fail"
},
"component": "LoveHatePizzaComponent"
},
{
"resolve": {
"yes": "lovesPizza"
},
"config": {
"outputOpts": {
"message": "Do you like pizza?"
}
},
"component": "LoveHatePizzaComponent.YesNoComponent",
"data": {
"numberOfTries": 0
}
}
],
"isNew": false,
"updatedAt": "2022-02-01T00:53:30.065Z",
"new": false
},
"user": {
"id": "81390558-0b21-4d30-b0b5-e8928bc79174",
"data": {}
}
}
}
<<<<< Response - 2022-02-01T00:53:32.275Z ✔️ 8ms
{
"version": "4.0.0",
"platform": "jovo-debugger",
"output": [],
"context": {
"request": {},
"session": {
"end": false,
"data": {},
"id": "0bf34a99-531a-4969-b694-e26eaaf6849f",
"state": [
{
"component": "GlobalComponent"
},
{
"resolve": {
"fail": "Fail"
},
"component": "LoveHatePizzaComponent"
},
{
"component": "LoveHatePizzaComponent"
}
]
},
"user": {
"data": {}
}
}
}
It seems like this logic doesn’t get called when routed in this way, and there is that extra
{
"component": "LoveHatePizzaComponent"
}
Error log
If you have an error log, please paste it here.
Your Environment
- Jovo Framework version used: 4.0.2
- Operating System: MacOS
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
getting an unhandled request error for requests that ... - GitHub
Describe the bug When using server.listen({onUnhandledRequest: 'error'}), I expect to see errors when there's an unhandled request, ...
Read more >ERR50-CPP. Do not abruptly terminate the program
In the situation where no matching handler is found, it is implementation-defined whether or not the stack is unwound before std::terminate() is called....
Read more >MSW logging warnings for unhandled Supertest requests
This feature was introduced in MSW v0.20.0, but in v0.29.0 the default setting for unhandled requests changed from "bypass" to "warn" ...
Read more >Process | Node.js v19.3.0 Documentation
Unhandled exceptions inherently mean that an application is in an undefined state. Attempting to resume application code without properly recovering from the ...
Read more >Let It Crash: Best Practices for Handling Node.js Errors on ...
The Node.js documentation says,. Unhandled exceptions inherently mean that an application is in an undefined state...The correct use of ' ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you, this was helpful.
I think I found a bug in our _mergeWith implementation: https://github.com/jovotech/jovo-framework/blob/v4/latest/platforms/platform-googleassistant/src/GoogleAssistantPlatform.ts#L71 The $session object isn’t merged properly.
I might have a fix, but I’m not sure of any side effects. Will do some tests and prepare a fix…
I also feel like this should be changed… Component data is not as handy as it should be.
El vie., 29 jul. 2022 15:28, Gianluca Acerbis @.***> escribió: