-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
The IContext.Send() methods in the Teams SDK do not currently support CancellationToken parameters, which is a best practice for async methods in .NET.
Current Behavior
The Send method signatures are:
Task<MessageActivity> Send(string text, bool isTargeted = false)
Task<MessageActivity> Send(IActivity activity)
Expected Behavior
All async Send methods should accept an optional CancellationToken parameter:
Task<MessageActivity> Send(string text, bool isTargeted = false, CancellationToken cancellationToken = default)
Task<MessageActivity> Send(IActivity activity, CancellationToken cancellationToken = default)Why This Matters
- Follows .NET async best practices
- Enables graceful cancellation and timeout handling
- Important for request cancellation and application shutdown scenarios
Copilot