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

bot.loadSession no longer behaving properly in 3.10.1

Open techno246 opened this issue 9 years ago • 4 comments

Bot Info

  • SDK Platform: Node.js
  • SDK Version: 3.10.1
  • Active Channels: Facebook
  • Deployment Environment: Elastic Beanstalk

Issue Description

bot.loadSession(address, done) is breaking on the latest release. When the function completes, the handler (done) is called twice - one with the session object, and one where it is set to null. Calling session.send() doesn't seem to work even in the instance where the session object exists. I have verified that the address exists and is valid.

Looking at the latest commits, it appears that loadSession has been refactored to call loadSessionWithOptionalDispatch(address, false, done), to incorporate the feature of optional dispatching. However, shouldn't it call loadSessionWithOptionalDispatch(address, true, done) instead, since loadSession used to dispatch by default?

Reverting to 3.9.1 fixed the issue.

techno246 avatar Sep 24 '17 06:09 techno246

exactly the same for me

dvorakjan avatar Sep 26 '17 15:09 dvorakjan

I was able to reproduce the problem and have created a PR that switches the 2nd parameter to true, which has UniversalBot.loadSession() returning to its original behavior.

PR that changed behavior: #3396

stevengum avatar Sep 26 '17 17:09 stevengum

I'm having a similar problem, although I don't see the callback being called twice. In my case, it gets called with the following error -- TypeError: Cannot read property 'callstack' of undefined

This was working fine in 3.9.1.

dan-cohn avatar Sep 26 '17 19:09 dan-cohn

resolved in [email protected] out now

nwhitmont avatar Sep 26 '17 23:09 nwhitmont