botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Dialog or session state not persisted in console emulator

Open DirkSonguer opened this issue 10 years ago • 4 comments

Summary: When using the command line emulator, dialogs are not followed through the waterfall + session data is not kept. Instead with every interaction the user does seems to be treated as new interaction.

Tested With:

  • Botbuilder v3.0
  • Microsoft Bot Framework Channel Emulator v3 (console, Mac OS 10.10.5)
  • Microsoft Bot Framework Channel Emulator v3 (GUI, Windows 10)
  • Node 4.4.7 on both OS

Steps to Reproduce:

  • Take code from here: https://gist.github.com/DirkSonguer/b0dc43e4054cfeb2229d6ca655f70a26
  • Run node with test code
  • Start Bot Framework Emulator
  • Say "hi" (anything will do)
  • Say "Dirk" (anything will do)

Expected Behaviour: This can be verified with the GUI emulator in Windows 10.

In Emulator:

  • User: "hi"
  • Bot: "Hi! What is your name?"
  • User: "Dirk"
  • Bot: "Hello Dirk"

In node console:

1: undefined
2
5
6
7[object Object]
1: Dirk
3
4

Actual Behaviour: This happens when the same code is run in the console emulator under Mac OS.

In Emulator:

  • User: "hi"
  • Bot: "Hi! What is your name?"
  • User: "Dirk"
  • Bot: "Hi! What is your name?"

In node console:

1: undefined
2
5
1: undefined
2
5

Regardless of input, the emulator / app will always put out 1,2,5, cycling "Hi! What is your name?".

See screenshot from Windows 10 and Mac OS here: https://postimg.org/image/ru01yqfdz/

DirkSonguer avatar Jul 12 '16 07:07 DirkSonguer

This still happens with Botbuilder 3.0.1. The output in console from the app is more verbose now:

Input in console emulator:

Send message to bot: hi User1 said: hi Bot1 said: Hi! What is your name? Dirk User1 said: Dirk Bot1 said: Hi! What is your name? Dirk User1 said: Dirk Bot1 said: Hi! What is your name?

Output in node console:

WARN: ChatConnector: receive - emulator running without security enabled.
ChatConnector: message received.
session.beginDialog(/)
/ - waterfall() step 0 of 2
1: undefined
2
/ - session.beginDialog(/profile)
./profile - waterfall() step 0 of 2
5
./profile - session.beginDialog(BotBuilder:Prompts)
..Prompts.text - session.send()
..Prompts.text - session.sendBatch() sending 1 messages
ChatConnector: sending message.
WARN: ChatConnector: receive - emulator running without security enabled.
ChatConnector: message received.
session.beginDialog(/)
/ - waterfall() step 0 of 2
1: undefined
2
/ - session.beginDialog(/profile)
./profile - waterfall() step 0 of 2
5
./profile - session.beginDialog(BotBuilder:Prompts)
..Prompts.text - session.send()
..Prompts.text - session.sendBatch() sending 1 messages
ChatConnector: sending message.
WARN: ChatConnector: receive - emulator running without security enabled.
ChatConnector: message received.
session.beginDialog(/)
/ - waterfall() step 0 of 2
1: undefined
2
/ - session.beginDialog(/profile)
./profile - waterfall() step 0 of 2
5
./profile - session.beginDialog(BotBuilder:Prompts)
..Prompts.text - session.send()
..Prompts.text - session.sendBatch() sending 1 messages
ChatConnector: sending message.

DirkSonguer avatar Jul 12 '16 08:07 DirkSonguer

Just tested with the console version under Windows 10 - it has the same behaviour as with Mac OS: 1,2,5 in a loop, not recognising dialogs and session data.

DirkSonguer avatar Jul 12 '16 11:07 DirkSonguer

related to #730. We should have a fix with a new build of console emulator.

msft-shahins avatar Jul 19 '16 00:07 msft-shahins

I can confirm that this is fixed in v3.0.6043.30574, good work, thank you!

DirkSonguer avatar Jul 19 '16 08:07 DirkSonguer