jovotech / jovo-framework

🔈 The React for Voice and Chat: Build Apps for Alexa, Messenger, Instagram, the Web, and more
https://www.jovo.tech
Apache License 2.0
1.68k stars 309 forks source link

Card gets lost if native response with directives is present #1356

Closed acerbisgianluca closed 2 years ago

acerbisgianluca commented 2 years ago

I'm submitting a...

Expected Behavior

I created an output class which returns a single output template with:

What I expect is a response with an outputSpeech, a reprompt and 2 directives (the dialog one and the apl render document one).

Current Behavior

Currently I only get an outputSpeech, a reprompt and only one directive (the dialog one), so it seems that the card gets lost or overwritten by the nativeResponse's directive.

Note: cards get correclty trasformend into an APL document in all other cases.

Your Environment

jankoenig commented 2 years ago

Hi @acerbisgianluca,

Thanks for flagging this. Could you create a repository with a minimal reproducible example? This would help us investigate the issue more quickly.

Thank you, Jan

acerbisgianluca commented 2 years ago

Hey @jankoenig, sure!

Here it's https://github.com/vocalime-base/jovo-issue-1356. Just run npm test and you'll see the problem I'm facing.

acerbisgianluca commented 2 years ago

@jankoenig I think that this issue is also affecting dynamic entities.

If I use the listen property to set dynamic entities, while at the same time adding an APLA directive in the nativeResponse, only the APLA directive appears in the output.

The problem in both cases seems to be the merge between the sanitized Jovo output and the native response object, which appears to take the precedence.

acerbisgianluca commented 2 years ago

Awesome, it works now! Thanks