Skip to content

Mark targeted messages and reactions as preview#363

Open
corinagum wants to merge 2 commits intomainfrom
cg/experimental-marking
Open

Mark targeted messages and reactions as preview#363
corinagum wants to merge 2 commits intomainfrom
cg/experimental-marking

Conversation

@corinagum
Copy link
Contributor

Add preview diagnostics for reactions (TEAMS0001) and targeted messages (TEAMS0002).

Customers will be required to opt-in in csproj:

<PropertyGroup>
  <NoWarn>$(NoWarn);TEAMS0001;TEAMS0002</NoWarn>
</PropertyGroup>

Copilot AI review requested due to automatic review settings March 6, 2026 22:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces preview diagnostics for two Teams SDK feature areas: reactions (TEAMS0001) and targeted messages (TEAMS0002). It uses C#'s [Experimental] attribute from System.Diagnostics.CodeAnalysis to mark these APIs as preview, requiring consumers to explicitly opt in by suppressing the diagnostics in their .csproj files. Internal library usages of these experimental APIs are suppressed via #pragma warning disable/restore directives.

Changes:

  • Adds [Experimental("TEAMS0001")] to ReactionType, Reaction, and ReactionClient classes, and [Experimental("TEAMS0002")] to IsTargeted, WithRecipient(Account, bool), CreateTargetedAsync, UpdateTargetedAsync, and DeleteTargetedAsync methods.
  • Adds #pragma warning disable/restore directives in library code that internally consumes these experimental APIs (e.g., ConversationClient, AspNetCorePlugin, Activity, MessageActivity, Message, MessageReactionActivity).
  • Updates .csproj files for test projects and sample projects to suppress the new TEAMS0001 and TEAMS0002 warnings as needed.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Libraries/Microsoft.Teams.Api/Messages/Reaction.cs Marks ReactionType and Reaction classes as [Experimental("TEAMS0001")]
Libraries/Microsoft.Teams.Api/Clients/ReactionClient.cs Marks ReactionClient class as [Experimental("TEAMS0001")]; fixes missing newline at EOF
Libraries/Microsoft.Teams.Api/Clients/ActivityClient.cs Marks CreateTargetedAsync, UpdateTargetedAsync, DeleteTargetedAsync as [Experimental("TEAMS0002")]
Libraries/Microsoft.Teams.Api/Activities/Activity.cs Marks IsTargeted property and WithRecipient(Account, bool) as [Experimental("TEAMS0002")]; adds pragma suppressions for internal usage
Libraries/Microsoft.Teams.Api/Activities/Message/MessageActivity.cs Adds pragma suppression for WithRecipient override calling experimental base method
Libraries/Microsoft.Teams.Api/Activities/Message/MessageReactionActivity.cs Adds file-level pragma suppression for TEAMS0001 due to heavy Reaction type usage
Libraries/Microsoft.Teams.Api/Messages/Message.cs Adds pragma suppression around Reactions property using experimental Reaction type
Libraries/Microsoft.Teams.Api/Clients/ConversationClient.cs Adds pragma suppressions around ReactionClient field declaration and initialization in all constructors
Libraries/Microsoft.Teams.Plugins/Microsoft.Teams.Plugins.AspNetCore/AspNetCorePlugin.cs Adds pragma suppression for IsTargeted and targeted method usage
Libraries/Microsoft.Teams.Apps/App.cs Adds pragma suppression for IsTargeted usage in validation
Tests/Microsoft.Teams.Apps.Tests/Microsoft.Teams.Apps.Tests.csproj Adds TEAMS0001;TEAMS0002 to NoWarn
Tests/Microsoft.Teams.Api.Tests/Microsoft.Teams.Api.Tests.csproj Adds TEAMS0001;TEAMS0002 to NoWarn
Samples/Samples.TargetedMessages/Samples.TargetedMessages.csproj Adds TEAMS0002 to NoWarn
Samples/Samples.Reactions/Samples.Reactions.csproj Adds TEAMS0001 to NoWarn

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants