deprecating noop#472
Draft
MehakBindra wants to merge 2 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces deprecation annotations across several Teams SDK models/clients (marking previously-used properties/methods as obsolete) and adds targeted warning suppressions in samples and library code to keep builds clean while the deprecation period runs.
Changes:
- Mark multiple API surface members as
[Obsolete]with planned removal messaging. - Add
#pragma warning disable/restore CS0618around internal/sample usages of newly-obsolete members to avoid build breaks (warnings-as-errors). - Add
Account.Typeas a new serialized field alongside the deprecatedAccount.Role.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Samples/Samples.TargetedMessages/Program.cs | Suppresses CS0618 around targeted send sample using deprecated Role. |
| Libraries/Microsoft.Teams.Plugins/Microsoft.Teams.Plugins.AspNetCore.DevTools/Controllers/ActivityController.cs | Suppresses CS0618 for deprecated Account.Role usage in devtools controller. |
| Libraries/Microsoft.Teams.Apps/Contexts/Context.SignIn.cs | Suppresses CS0618 for deprecated RelatesTo, InputHint, and conversation create request fields. |
| Libraries/Microsoft.Teams.Apps/Contexts/Client/FunctionContext.cs | Adds CS0618 suppressions for deprecated conversation create request fields and Account.Role (contains a compile-breaking initializer issue). |
| Libraries/Microsoft.Teams.Apps/App.cs | Suppresses CS0618 for deprecated Account.Role when building bot conversation reference. |
| Libraries/Microsoft.Teams.Apps/Activities/Conversations/ConversationEndActivity.cs | Disables CS0618 for the file to accommodate EndOfConversationActivity deprecation. |
| Libraries/Microsoft.Teams.Api/Clients/MemberClient.cs | Marks DeleteAsync obsolete. |
| Libraries/Microsoft.Teams.Api/Clients/ConversationClient.cs | Marks legacy create-request fields obsolete. |
| Libraries/Microsoft.Teams.Api/Attachment.cs | Marks Attachment.Id obsolete. |
| Libraries/Microsoft.Teams.Api/Activities/Message/MessageActivity.cs | Marks several message fields and builder helpers obsolete; adds suppressions for internal usage. |
| Libraries/Microsoft.Teams.Api/Activities/Conversation/EndOfConversationActivity.cs | Marks end-of-conversation activity and code types obsolete. |
| Libraries/Microsoft.Teams.Api/Activities/Activity.cs | Marks RelatesTo obsolete; suppresses obsolete usage where required. |
| Libraries/Microsoft.Teams.Api/Activities/Activity.JsonConverter.cs | Suppresses CS0618 for end-of-conversation (de)serialization paths. |
| Libraries/Microsoft.Teams.Api/Activities/Activity.Convertible.cs | Suppresses CS0618 for end-of-conversation conversions. |
| Libraries/Microsoft.Teams.Api/Account.cs | Deprecates Role and introduces new serialized Type property. |
Comments suppressed due to low confidence (1)
Libraries/Microsoft.Teams.Api/Clients/MemberClient.cs:52
DeleteAsyncis now marked obsolete, but the message doesn’t indicate what API callers should move to (or whether this is being removed because it’s unused/no-op). Please update the[Obsolete]message to include the recommended replacement (or guidance on how to achieve the same outcome).
[Obsolete("This will be removed by end of summer 2026.")]
public async Task DeleteAsync(string conversationId, string memberId, CancellationToken cancellationToken = default)
{
var token = cancellationToken != default ? cancellationToken : _cancellationToken;
var request = HttpRequest.Delete($"{ServiceUrl}v3/conversations/{conversationId}/members/{memberId}");
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
69
to
87
| @@ -81,6 +83,7 @@ public class CreateRequest | |||
|
|
|||
| [JsonPropertyName("topicName")] | |||
| [JsonPropertyOrder(3)] | |||
| [Obsolete("This will be removed by end of summer 2026.")] | |||
| public string? TopicName { get; set; } | |||
Comment on lines
77
to
86
| #pragma warning disable CS0618 | ||
| IsGroup = false, | ||
| Bot = new() | ||
| { | ||
| Id = app.Id, | ||
| Name = app.Name, | ||
| Role = Role.Bot | ||
| }, | ||
| #pragma warning restore CS0618 | ||
| Members = [ |
Comment on lines
+4
to
+5
| #pragma warning disable CS0618 | ||
|
|
Comment on lines
22
to
+33
| [JsonPropertyName("role")] | ||
| [JsonPropertyOrder(2)] | ||
| [Obsolete("This will be removed by end of summer 2026.")] | ||
| public Role? Role { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// The type of the account. Possible values: 'person', 'bot', 'channel', 'team', 'tag'. | ||
| /// Primarily present on mention entities for non-person accounts. Absent for regular person accounts. | ||
| /// </summary> | ||
| [JsonPropertyName("type")] | ||
| [JsonPropertyOrder(7)] | ||
| public string? Type { get; set; } |
Comment on lines
+67
to
+69
| #pragma warning disable CS0618 | ||
| "endOfConversation" => element.Deserialize<EndOfConversationActivity>(options), | ||
| #pragma warning restore CS0618 |
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.
No description provided.