Skip to content
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

Node.js ConsoleConnector fails to reset Session.sendingBatch #1023

Closed
Thegaram opened this issue Aug 17, 2016 · 3 comments
Closed

Node.js ConsoleConnector fails to reset Session.sendingBatch #1023

Thegaram opened this issue Aug 17, 2016 · 3 comments
Assignees

Comments

@Thegaram
Copy link

The code below sends only one message instead of two.

var connector = new builder.ConsoleConnector().listen();
var bot = new builder.UniversalBot(connector, {
    autoBatchDelay: 0
});

bot.dialog('/', function (session) {
    session.send("First");

    setTimeout(() => { 
        session.send("Second");
    }, 0);
});

When we call Session.send, the code flow will eventually reach ConsoleConnector.send. As this function does not call the provided callback (unlike ChatConnector.send), session.sendingBatch will not be reset to false, and subsequent calls to Session.send will be ignored (due to the check in Session.startBatch).

Note: without the timeout this issue will not arise, as Session does automatic batching inside the time interval defined by autoBatchDelay (for which the default is 250ms).

@Stevenic
Copy link
Contributor

Looks like you fixed the issue... thanks. Will be in next release.

@palmerabollo
Copy link
Contributor

We're also facing this issue. Any plans to release a new nodejs sdk version?

@Stevenic
Copy link
Contributor

Should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants