Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR aligns the TypeScript API models with current service behavior by adding deprecation annotations to activity-related types/properties that are no longer returned or recognized by the backend.
Changes:
- Added
@deprecatedJSDoc torelatesToacrossIActivity,Activity, and many derived activity interfaces, pluswithRelatesTo. - Deprecated activity interfaces/types not recognized by the backend (
IHandoffActivity,ITraceActivity,IEndOfConversationActivity,EndOfConversationCode) and thehistoryDisclosedproperty. - Marked several message activity fields and builder methods (e.g.,
speak,inputHint,importance,expiration) as deprecated, and updatedAccount/Attachmentdocs to reflect backend outputs.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/api/src/models/attachment/attachment.ts | Deprecates Attachment.id as no longer returned by backend. |
| packages/api/src/models/account.ts | Deprecates role, makes it optional, and adds type to reflect backend behavior. |
| packages/api/src/activities/trace.ts | Deprecates ITraceActivity and relatesTo for trace activities. |
| packages/api/src/activities/message/message.ts | Deprecates message fields and fluent setters not recognized by backend. |
| packages/api/src/activities/message/message-update.ts | Deprecates message-update fields and fluent setters not recognized by backend. |
| packages/api/src/activities/invoke/task/task-submit.ts | Deprecates relatesTo on task submit invoke activity. |
| packages/api/src/activities/invoke/task/task-fetch.ts | Deprecates relatesTo on task fetch invoke activity. |
| packages/api/src/activities/invoke/tab/tab-submit.ts | Deprecates relatesTo on tab submit invoke activity. |
| packages/api/src/activities/invoke/tab/tab-fetch.ts | Deprecates relatesTo on tab fetch invoke activity. |
| packages/api/src/activities/invoke/message/submit-action.ts | Deprecates relatesTo on message submit-action invoke activity. |
| packages/api/src/activities/invoke/message-extension/submit-action.ts | Deprecates relatesTo on messaging extension submit-action invoke activity. |
| packages/api/src/activities/invoke/message-extension/setting.ts | Deprecates relatesTo on messaging extension setting invoke activity. |
| packages/api/src/activities/invoke/message-extension/select-item.ts | Deprecates relatesTo on messaging extension select-item invoke activity. |
| packages/api/src/activities/invoke/message-extension/query.ts | Deprecates relatesTo on messaging extension query invoke activity. |
| packages/api/src/activities/invoke/message-extension/query-setting-url.ts | Deprecates relatesTo on messaging extension query-setting-url invoke activity. |
| packages/api/src/activities/invoke/message-extension/query-link.ts | Deprecates relatesTo on messaging extension query-link invoke activity. |
| packages/api/src/activities/invoke/message-extension/fetch-task.ts | Deprecates relatesTo on messaging extension fetch-task invoke activity. |
| packages/api/src/activities/invoke/message-extension/card-button-clicked.ts | Deprecates relatesTo on messaging extension card-button-clicked invoke activity. |
| packages/api/src/activities/invoke/message-extension/anon-query-link.ts | Deprecates relatesTo on messaging extension anon-query-link invoke activity. |
| packages/api/src/activities/invoke/handoff-action.ts | Deprecates relatesTo on handoff-action invoke activity. |
| packages/api/src/activities/invoke/file-consent.ts | Deprecates relatesTo on file-consent invoke activity. |
| packages/api/src/activities/invoke/execute-action.ts | Deprecates relatesTo on execute-action invoke activity. |
| packages/api/src/activities/invoke/config/config-submit.ts | Deprecates relatesTo on config submit invoke activity. |
| packages/api/src/activities/invoke/config/config-fetch.ts | Deprecates relatesTo on config fetch invoke activity. |
| packages/api/src/activities/handoff.ts | Deprecates IHandoffActivity as not recognized by backend. |
| packages/api/src/activities/conversation/end-of-conversation.ts | Deprecates end-of-conversation activity interface + code type. |
| packages/api/src/activities/conversation/conversation-update.ts | Deprecates historyDisclosed as not recognized by backend. |
| packages/api/src/activities/activity.ts | Deprecates base relatesTo and withRelatesTo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
I don't think we can fully remove fields that are part of the official activity protocol from Activity or MessageActivity or MessageUpdateActivity themselves for compat reasons. Similar to channelData and replyToId. I totally agree with cleaning up our usage and deprecating old ABS code, but not acknowledging what's on the protocol doesn't set us up well for the future.
microsoft/teams.py#239 stems from a problem of Teams SDK models diverging from the activity protocol contarct. It applies to these as well, especially for speak and inputHint which are related to accessibility.
I think for the time being, the deprecation notes should be removed from the items on activity and message activity, message update activity and we continue the discussion on channels support internally.
equivalent to these 2 python PRs:
microsoft/teams.py#340 (not all applicable bc TS doesnt have defined inbound/outbound interfaces)
microsoft/teams.py#336
This pull request adds deprecation warnings to several activity-related interfaces and types to clarify that certain properties and activities are no longer recognized or returned by the service backend. This improves the clarity of the API and helps developers avoid using obsolete features. Verified with APX repo and manual testing.
Deprecation of properties and activities:
relatesToproperty as deprecated in the baseIActivityinterface, theActivityclass, and in all derived activity interfaces where it appears, indicating it is no longer returned by the backend.@deprecatedannotations to thewithRelatesTomethod in theActivityclass for consistency.Deprecation of activity types not recognized by the backend:
IHandoffActivityandITraceActivityinterfaces as deprecatedIEndOfConversationActivityinterface andEndOfConversationCodetype as deprecated