v2.0.6
New Features
CancellationToken Support
- All async methods now accept optional
CancellationTokenparameters (fully backwards-compatible)
Targeted Messages (Preview) - ExperimentalTeamsTargeted
- Send messages visible only to specific recipients:
activity.WithRecipient(account, isTargeted: true)
Reactions (Preview) - ExperimentalTeamsReactions
- New
ReactionClientfor bot-to-user reactions with expanded reaction types
Sign-in Failure Handling
- New
signin/failureinvoke handling with actionable logging viaapp.OnSignInFailure()
Breaking Changes
GetParticipantAsync- Now requirestenantIdparameterMeetingParticipant- Model restructured (removedId,Role,IsOrganizer,JoinTime; addedMeeting,Conversation)App.Id- Now nullableActivity.Value- Refactored for proper type hierarchy access
Deprecations
- Teams Controllers - Marked
[Obsolete], migrate to Minimal APIs (seeDeprecated.Controllerssample) - Handlers without CancellationToken - Marked
[Obsolete], update handler signatures MessageReactionActivity.AddReaction()/.RemoveReaction()- Marked[Obsolete], useReactionClientinstead
Fixes
- Meeting activity deserialization for Teams PascalCase payloads
- UserAgent version accuracy
- GetParticipantAsync signature and data structure
Updates
- Package: System.IdentityModel.Tokens.Jwt v8.16.0
- Samples: Updated to Minimal APIs and Local environment
- New Samples: Reactions, TargetedMessages, Deprecated.Controllers
Migration
Opt-in to preview features:
<PropertyGroup>
<NoWarn>$(NoWarn);ExperimentalTeamsReactions;ExperimentalTeamsTargeted</NoWarn>
</PropertyGroup>Controllers → Minimal APIs:
Before (Deprecated):
[TeamsController]
public class MainController : MessageController
{
[OnMessage]
public Task OnMessage() { ... }
}After:
teams.OnMessage(async (context, cancellationToken) =>
{
await context.Send("Hello!");
});Add CancellationToken:
Before (Obsolete):
teams.OnMessage(async (context) => { ... });After:
teams.OnMessage(async (context, cancellationToken) => { ... });Targeted Messages:
Before:
activity.WithTargetedRecipient(userId);After:
activity.WithRecipient(account, isTargeted: true);Reactions:
Before:
messageReactionActivity.AddReaction(reaction);After:
await context.Api.Conversations.Reactions.CreateAsync(
conversationId,
activityId,
reaction
);Appendix (PRs merged)
- Fix meeting activity deserialization for Teams PascalCase payloads by @Copilot in #198
- Update samples to minimal apis by @rido-min in #220
- Update samples to use Local environment by @rido-min in #273
- Update UserAgent to use AssemblyFileVersion by @rido-min in #238
- Fix GetParticipantAsync by @rido-min in #277
- Bump main to v2.0.6-preview by @singhk97 in #278
- Deprecate Teams Controllers by @rido-min in #281
- Update pipelines by @singhk97 in #291
- Revert Targeted Messages support (PR #195 and #222) by @ShanmathiMayuramKrithivasan in #290
- Add support for Targeted Messages by @ShanmathiMayuramKrithivasan in #303
- Add missing cancellation tokens by @rido-min in #317
- Create preview publish script for ADO by @corinagum in #323
- Git Ignore launchSettings and appsettings.Development by @rido-min in #298
- Simplify TargetedMessages with an overload in WithRecipient() by @rido-min in #318
- Make App.Id nullable instead of required by @rido-min in #348
- [Fix]: sync invoke activity Value property to base for access across type hierarchy by @MehakBindra in #340
- Add Reactions Feature (Bot to User) by @rido-min in #335
- Feat: add signin/failure invoke handling by @corinagum in #347
- Rename
OnFailureActivitytoOnSignInFailureActivityby @corinagum in #364 - Mark targeted messages and reactions as preview by @corinagum in #363
- Update CodeQL workflow to include 'next/core' branch by @singhk97 in #375
- Update Jwt package to v8.16.0 in Teams projects by @rido-min in #372
- Move IsTargeted property from Activity to Account by @ShanmathiMayuramKrithivasan in #365
- Add per-call CancellationToken to async client methods by @Copilot in #395
- Add [Obsolete] shims for non-cancellation token handlers by @rido-min in #405
- chore: migrate publish.yml pipeline to 1ES template by @singhk97 in #404
- fix: pipeline fixes after testing by @singhk97 in #409
- fix: pipelines - add publish credentials by @singhk97 in #411
- chore: Add default params to cancellation token for backwards compatibility by @singhk97 in #412
Full Changelog: v2.0.5...v2.0.6