{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/1023","repository_url":"https://api.github.com/repos/Microsoft/BotBuilder","labels_url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/1023/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/1023/comments","events_url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/1023/events","html_url":"https://github.com/Microsoft/BotBuilder/issues/1023","id":171758292,"number":1023,"title":"Node.js ConsoleConnector fails to reset Session.sendingBatch","user":{"login":"Thegaram","id":7571518,"avatar_url":"https://avatars.githubusercontent.com/u/7571518?v=3","gravatar_id":"","url":"https://api.github.com/users/Thegaram","html_url":"https://github.com/Thegaram","followers_url":"https://api.github.com/users/Thegaram/followers","following_url":"https://api.github.com/users/Thegaram/following{/other_user}","gists_url":"https://api.github.com/users/Thegaram/gists{/gist_id}","starred_url":"https://api.github.com/users/Thegaram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thegaram/subscriptions","organizations_url":"https://api.github.com/users/Thegaram/orgs","repos_url":"https://api.github.com/users/Thegaram/repos","events_url":"https://api.github.com/users/Thegaram/events{/privacy}","received_events_url":"https://api.github.com/users/Thegaram/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"Stevenic","id":698939,"avatar_url":"https://avatars.githubusercontent.com/u/698939?v=3","gravatar_id":"","url":"https://api.github.com/users/Stevenic","html_url":"https://github.com/Stevenic","followers_url":"https://api.github.com/users/Stevenic/followers","following_url":"https://api.github.com/users/Stevenic/following{/other_user}","gists_url":"https://api.github.com/users/Stevenic/gists{/gist_id}","starred_url":"https://api.github.com/users/Stevenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stevenic/subscriptions","organizations_url":"https://api.github.com/users/Stevenic/orgs","repos_url":"https://api.github.com/users/Stevenic/repos","events_url":"https://api.github.com/users/Stevenic/events{/privacy}","received_events_url":"https://api.github.com/users/Stevenic/received_events","type":"User","site_admin":false},"assignees":[{"login":"Stevenic","id":698939,"avatar_url":"https://avatars.githubusercontent.com/u/698939?v=3","gravatar_id":"","url":"https://api.github.com/users/Stevenic","html_url":"https://github.com/Stevenic","followers_url":"https://api.github.com/users/Stevenic/followers","following_url":"https://api.github.com/users/Stevenic/following{/other_user}","gists_url":"https://api.github.com/users/Stevenic/gists{/gist_id}","starred_url":"https://api.github.com/users/Stevenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stevenic/subscriptions","organizations_url":"https://api.github.com/users/Stevenic/orgs","repos_url":"https://api.github.com/users/Stevenic/repos","events_url":"https://api.github.com/users/Stevenic/events{/privacy}","received_events_url":"https://api.github.com/users/Stevenic/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-08-17T20:56:21Z","updated_at":"2016-08-23T19:53:37Z","closed_at":"2016-08-23T19:53:37Z","body":"The code below sends only one message instead of two.\r\n\r\n```js\r\nvar connector = new builder.ConsoleConnector().listen();\r\nvar bot = new builder.UniversalBot(connector, {\r\n    autoBatchDelay: 0\r\n});\r\n\r\nbot.dialog('/', function (session) {\r\n    session.send(\"First\");\r\n\r\n    setTimeout(() => { \r\n        session.send(\"Second\");\r\n    }, 0);\r\n});\r\n```\r\n\r\nWhen 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`).\r\n\r\nNote: 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)."}}
{"actor":{"display_login":"Thegaram"}}