Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UNHANDLED default behaviour #1273

Open
1 task done
debocsh opened this issue Apr 10, 2022 · 4 comments
Open
1 task done

UNHANDLED default behaviour #1273

debocsh opened this issue Apr 10, 2022 · 4 comments

Comments

@debocsh
Copy link

debocsh commented Apr 10, 2022

I'm submitting a...

  • Documentation issue or request
    As mentioned in the docs, unhandled will always be prioritized

image

My question is what was the thought behind this ? I would have expected that "Unhandled" will be fulfilled if the input has no matching intent. Here, it seems that **Unhandled** has more weight than other handlers even if the input matched intent in another components.

I ran into the same scenario that you quote in the docs
image

Since it's the default behaviour, should we have also an option to cancel it instead of using prioritizedOverUnhandled or intentsToSkipUnhandled which needs to be added on each new intent ? Does it mean that once I have one component with the Unhandled behaviour, I'll be stuck in this loop ?
I'll appreciate if you can provide more information/explanation about the UNHANDLED handler role and why this is the default behaviour ?

  • Jovo Framework version used: 4.1.3
  • Operating System:
    Linux 5.10 Debian
    Node: 16.14.0
@jrglg
Copy link
Contributor

jrglg commented Apr 10, 2022 via email

@fbublitz
Copy link
Contributor

If you do not have an UNHANDLED Handler in your Component in question, you achieve the behavior that you want i think. The routing can find Intent handlers in other components. So its basically your decision if you want to create this blocking loop for the user.
If you have not delegated to a component in the previous dialouge step, the routing even searches upwards the hierarchy in the component tree, being able to match a non global handler for the intent in the "mother" component or further up.

But if you have delegated to the component and there is no UNHANDLED handler, the component does not resolve, (which makes me wonder what happens on the state stack in that case...) and the routing can only find Global handlers in the Top Level components i think. This is a bit odd, since we explicitly have to declare components that we want to delegate to as child components.

@jrglg
Copy link
Contributor

jrglg commented Apr 21, 2022

@fbublitz, that's correct. Furthermore it is also possible to have a component twice on the stack. At the moment I have no problems handling these cases, in fact it works quite well if you play with the annotations.

@jankoenig @aswetlow I think it would be really interesting to have the ability to keep only ONE component on the stack. Avoiding keeping duplicates, with some mechanism (maybe some annotation). Basically because in more complicated logics, component-level memory doesn't work, since the necessary data may be in another "instance" of the same component.

@fbublitz
Copy link
Contributor

@jrglg i checked the behavior again and it turned out i was a partly wrong in my but part with the delegation. So when component X delegates to component Y and the next request comes in with intent myIntent , which is not handled in Y . The routing can find myIntent in the X component first (and it does not have to be a global handler) before looking in other components. This is quite nice and more what you would expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants