Skip to content

Add CancellationToken support to IContext.Send() methods #269

@YugalPradhan31

Description

@YugalPradhan31

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)
Image

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions