-
Notifications
You must be signed in to change notification settings - Fork 292
Added buffered delivery mode support. #1783
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b4e4021
Added buffered delivery mode support.
Stevenic 89f23cb
Renamed buffered to bufferedReplies
Stevenic f1b6fc2
Fixed some test issues
Stevenic 72876bd
Disabled date tests that don't work in the Pacific Time Zone
Stevenic 6dc1215
Merge branch 'master' into stevenic/buffered-output
Stevenic a01675a
Merge branch 'master' into stevenic/buffered-output
johnataylor 6e9bb9d
tested end to end plus some fixes
johnataylor 9bc9949
Merge branch 'master' into stevenic/buffered-output
johnataylor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --require ts-node/register | ||
| --require source-map-support/register | ||
| --recursive | ||
| **/*.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
|
|
||
| const { ActivityHandler } = require('botbuilder'); | ||
|
|
||
| class ChildBot extends ActivityHandler { | ||
|
|
||
| constructor() { | ||
| super(); | ||
|
|
||
| this.onMessage(async (context, next) => { | ||
| await context.sendActivity('hello from child'); | ||
| await next(); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| module.exports.ChildBot = ChildBot; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
|
|
||
| const restify = require('restify'); | ||
|
|
||
| const { BotFrameworkAdapter } = require('botbuilder'); | ||
| const { ChildBot } = require('./childBot'); | ||
|
|
||
| const adapter = new BotFrameworkAdapter(); | ||
|
|
||
| // Create HTTP server | ||
| const server = restify.createServer(); | ||
| server.listen(3979, function() { | ||
| console.log(`\n${ server.name } listening to ${ server.url }`); | ||
| console.log(`\nGet Bot Framework Emulator: https://aka.ms/botframework-emulator`); | ||
| }); | ||
|
|
||
| const bot = new ChildBot(); | ||
|
|
||
| // Listen for incoming activities and route them to your bot main dialog. | ||
| server.post('/api/messages', (req, res) => { | ||
| // Route received a request to adapter for processing | ||
| adapter.processActivity(req, res, async (turnContext) => { | ||
| // route to bot activity handler. | ||
| await bot.run(turnContext); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "name": "skillchild", | ||
| "version": "1.0.0", | ||
| "description": "", | ||
| "main": "index.js", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| }, | ||
| "author": "", | ||
| "license": "ISC", | ||
| "dependencies": { | ||
| "botbuilder": "4.1.6", | ||
| "restify": "^8.5.1" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
|
|
||
| const restify = require('restify'); | ||
|
|
||
| const { BotFrameworkAdapter } = require('botbuilder'); | ||
| const { ParentBot } = require('./parentBot'); | ||
|
|
||
| const adapter = new BotFrameworkAdapter(); | ||
|
|
||
| // Create HTTP server | ||
| const server = restify.createServer(); | ||
| server.listen(3978, function() { | ||
| console.log(`\n${ server.name } listening to ${ server.url }`); | ||
| console.log(`\nGet Bot Framework Emulator: https://aka.ms/botframework-emulator`); | ||
| }); | ||
|
|
||
| const bot = new ParentBot(); | ||
|
|
||
| // Listen for incoming activities and route them to your bot main dialog. | ||
| server.post('/api/messages', (req, res) => { | ||
| // Route received a request to adapter for processing | ||
| adapter.processActivity(req, res, async (turnContext) => { | ||
| // route to bot activity handler. | ||
| await bot.run(turnContext); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "name": "skillparent", | ||
| "version": "1.0.0", | ||
| "description": "", | ||
| "main": "index.js", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| }, | ||
| "author": "", | ||
| "license": "ISC", | ||
| "dependencies": { | ||
| "botbuilder": "4.1.6", | ||
| "botframework-connector": "4.1.6", | ||
| "restify": "^8.5.1" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
|
|
||
| const { ActivityHandler, ActivityTypes, DeliveryModes, TurnContext, BotFrameworkHttpClient } = require('botbuilder'); | ||
| const { SimpleCredentialProvider } = require('botframework-connector'); | ||
|
|
||
| class ParentBot extends ActivityHandler { | ||
|
|
||
| constructor() { | ||
| super(); | ||
|
|
||
| const client = new BotFrameworkHttpClient(new SimpleCredentialProvider('', '')); | ||
|
|
||
| this.onMessage(async (context, next) => { | ||
|
|
||
| await context.sendActivity('parent: before child'); | ||
|
|
||
| var activity = { type: ActivityTypes.Message, text: 'parent to child' }; | ||
| TurnContext.applyConversationReference(activity, TurnContext.getConversationReference(context.activity), true); | ||
| activity.deliveryMode = DeliveryModes.BufferedReplies; | ||
|
|
||
| var response = await client.postActivity( | ||
| null, | ||
| 'toBotId', | ||
| 'http://localhost:3979/api/messages', | ||
| 'http://tempuri.org/whatever', | ||
| 'random-guid', | ||
| activity); | ||
|
|
||
| if (response.status == 200) | ||
| { | ||
| await context.sendActivities(response.body); | ||
| } | ||
|
|
||
| await context.sendActivity('parent: after child'); | ||
|
|
||
| await next(); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| module.exports.ParentBot = ParentBot; | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.