-
Notifications
You must be signed in to change notification settings - Fork 283
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
cleanup: middleware handling #2951
Conversation
f93e8bc
to
ba38eba
Compare
ba38eba
to
64c5334
Compare
} else if (typeof plugin === 'object' && plugin.onTurn) { | ||
this.middleware.push((context: TurnContext, next: Function) => plugin.onTurn(context, next)); | ||
this.middleware.push((context, next) => plugin.onTurn(context, next)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if we'll ever get to this, but I'd like to get your input and formalize the JS SDKs expectation for complex parameters that exist as implementations in the SDK.
We communicate to developers that they have to consume all BF SDK dependencies in lock-step, mostly because that's the extent of our test matrix (packages are tested against the same version)... But also because if a bot consumes two different versions of a given botbuilder-*
package, it may blow up due to instanceof
misalignment. And in TypeScript scenarios, the project might not build due to ambiguous types due to multiple versions of a botbuilder-*
package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And my last but favorite point, interfaces have different semantics between C# and TypeScript at runtime. And Python doesn't have interfaces at all (abc
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
390b0bd
to
20f0f39
Compare
20f0f39
to
543336d
Compare
* Overhaul middlewareSet tests * Clean up middleware handling logic * Expand BotAdapter tests with error handling tests Co-authored-by: Steven Gum <[email protected]>
* Overhaul middlewareSet tests * Clean up middleware handling logic * Expand BotAdapter tests with error handling tests Co-authored-by: Steven Gum <[email protected]> Co-authored-by: Steven Gum <[email protected]>
ShowTypingMiddleware
where a promise rejection would yield never-ending typing activitiesThese changes are all a precursor to the
immediateAccept
change. The rewritten code was all an effort to make therunMiddleware
chain easier to read through. I introduced extensive middleware testing before making changes to ensure there are no new issues introduced.