This is a crucial field to proper serial execution of the BotTester framework. session.save occurs asynchronously in UniversalBot batch executions. We do not want to be able to load a session if session.save has been called, but the bot's batch has yet to execute. This promise will be set to resolved when the bot's latest batch has finished, should the framework be watching for a save call. This value is defaulted to a resolved promise.
adds middleware to the bot that checks for incoming load messages sent by createSessionWrapperWithLoadMessageOverride's bot.createSession wrapper. This lets us know that the message was never meant to go through the bot's middelware and ignore it. The session loaded into this message is then used as the value that the Promise returned from getSession resolves to
Adds a routing event listner which is the first execution path called after a session has been successfully loaded. If this session has not already gone through this listener, then it wraps session.save in a function that sends the internal save message that is mocked to be sent to the user, and thereby intercepted by the MessageService. This ensures that the test runner does not continue preemptively. When the session's save method is called, the message is actually sent and alerts the BotTester framework
This is a delicate hack that relies on accessing and modifying the private field createSession on UniversalBot. This makes the bot's next createSession call result in a session with a message of type 'load'. This allows the sessionLoadListener to know if a message that the bot thinks it received was actually the result of a call to bot.createSession
address of the message that is being loaded
a message internal to the BotTester framework. Due limitations in the botbuilder framework, this message is sent to the bot whenever session.save is called. This allows the framework to know when session.save is called and resolve accordingly. Without this, the session state may not be persisted before the next test step is run
address that the save message should come from
fetches a session for a particular address
address of session to load
Loads a session associated with an address.
address to be loaded
Service that provides session for addresses. Injects code into a Universal bot to allow session save and load listeners to work