-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix(testing): create new session before recording #11693
fix(testing): create new session before recording #11693
Conversation
DEV-1089 Testing module (botpress/botpress botpress/v12#1087)
Describe the bug
To Reproduce:
Expected behavior
To Reproduce:
Expected behavior Environment :
Additional context |
import { Preview, Scenario, Status } from '../../backend/typings' | ||
import NoScenarios from './NoScenarios' | ||
import ScenarioComponent from './Scenario' | ||
import ScenarioRecorder from './ScenarioRecorder' | ||
import style from './style.scss' | ||
|
||
const WEBCHAT_READY_TIMEOUT = 10000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted for a 10sec timeout since I simply don't want to be waiting indefinitely if something goes wrong but at the same time I want to give the webchat all the time it need to create the new session.
}) | ||
|
||
// Sends a request to the emulator to create a new session (new user, new socket connection, and new conversation) | ||
win.postMessage({ action: 'new-session' }, '*') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same logic used in the debugged to create a new session (or reset it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR fixes an issue where recording a scenario starting from the middle of a flow would result in the scenario always failing. To solve the issue, I see two possibilities.
Closes: botpress/v12#1087