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

feat: immediate accept #2950

Merged
merged 3 commits into from
Nov 17, 2020
Merged

feat: immediate accept #2950

merged 3 commits into from
Nov 17, 2020

Conversation

joshgummersall
Copy link
Contributor

Fixes microsoft/botframework-sdk#6005

This PR introduces a new BotFrameworkAdapter option for immediateAccept. This feature, while useful, is potentially dangerous as it can lead to silent errors and unpredictable behavior in shared hosting environments. That said, it may be useful for certain users that leverage middleware chains or bot logic that takes a long time to execute.

The immediateAccept setting can be either a simple boolean flag or a function that is passed an activity and must return a boolean value. Under certain special scenarios, this setting is entirely ignored.

Note: This PR also introduces some refactoring to the code that simplifies middleware execution and better leverages newer Javascript features and Typescript type inference.

@joshgummersall joshgummersall marked this pull request as draft October 23, 2020 20:16
@joshgummersall joshgummersall changed the base branch from main to jpg/refactor-middleware-set October 23, 2020 22:17
@joshgummersall joshgummersall force-pushed the jpg/refactor-middleware-set branch from edbdade to f93e8bc Compare October 26, 2020 16:19
@joshgummersall joshgummersall force-pushed the jpg/refactor-middleware-set branch from f93e8bc to ba38eba Compare October 26, 2020 21:51
@joshgummersall joshgummersall force-pushed the jpg/refactor-middleware-set branch from ba38eba to 64c5334 Compare October 27, 2020 19:36
@joshgummersall joshgummersall force-pushed the jpg/immediate-accept branch 2 times, most recently from eb7641b to 9404190 Compare October 30, 2020 17:19
@joshgummersall joshgummersall force-pushed the jpg/refactor-middleware-set branch from 390b0bd to 20f0f39 Compare October 30, 2020 17:24
@joshgummersall joshgummersall force-pushed the jpg/refactor-middleware-set branch from 20f0f39 to 543336d Compare October 30, 2020 17:29
Base automatically changed from jpg/refactor-middleware-set to main October 30, 2020 17:57
@joshgummersall joshgummersall marked this pull request as ready for review October 30, 2020 17:58
@joshgummersall joshgummersall force-pushed the jpg/immediate-accept branch 2 times, most recently from 8d06478 to f878774 Compare November 2, 2020 16:28
@joshgummersall joshgummersall force-pushed the jpg/immediate-accept branch 2 times, most recently from ba96b0f to 6f16786 Compare November 9, 2020 20:23
@scheyal
Copy link
Contributor

scheyal commented Nov 12, 2020

please notify @scheyal when ready to share bits with customers. Thank you :)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 367159326

  • 9 of 13 (69.23%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 84.789%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/botbuilder/src/botFrameworkAdapter.ts 9 13 69.23%
Totals Coverage Status
Change from base Build 367020635: -0.02%
Covered Lines: 17306
Relevant Lines: 19491

💛 - Coveralls

@joshgummersall joshgummersall merged commit cdfa484 into main Nov 17, 2020
@joshgummersall joshgummersall deleted the jpg/immediate-accept branch November 17, 2020 01:15
joshgummersall added a commit that referenced this pull request Nov 17, 2020
* Add support for `immediateAccept` option

Fixes microsoft/botframework-sdk#6005

* strict boolean coercion
joshgummersall added a commit that referenced this pull request Nov 18, 2020
* Add support for `immediateAccept` option

Fixes microsoft/botframework-sdk#6005

* strict boolean coercion
joshgummersall added a commit that referenced this pull request Nov 24, 2020
joshgummersall added a commit that referenced this pull request Nov 24, 2020
stevengum pushed a commit that referenced this pull request Nov 24, 2020
joshgummersall added a commit that referenced this pull request Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants