Mark targeted messages and reactions as preview#363
Open
Conversation
Contributor
There was a problem hiding this comment.
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")]toReactionType,Reaction, andReactionClientclasses, and[Experimental("TEAMS0002")]toIsTargeted,WithRecipient(Account, bool),CreateTargetedAsync,UpdateTargetedAsync, andDeleteTargetedAsyncmethods. - Adds
#pragma warning disable/restoredirectives in library code that internally consumes these experimental APIs (e.g.,ConversationClient,AspNetCorePlugin,Activity,MessageActivity,Message,MessageReactionActivity). - Updates
.csprojfiles 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add preview diagnostics for reactions (TEAMS0001) and targeted messages (TEAMS0002).
Customers will be required to opt-in in csproj: