Allow unknown activity entities and missing channelData#438
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds forward-compatible handling for unknown activity entity types and relaxes conversationUpdate parsing when channelData is absent.
Changes:
- Introduces
UnknownEntityand includes it in theEntityunion / exports. - Updates
ConversationUpdateActivity.channel_datato be optional with a default ofNone. - Adds unit tests validating
ActivityTypeAdapterbehavior for unknown entities and missingchannelData.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/api/tests/unit/test_activity.py | Adds unit coverage for unknown entity passthrough and optional channel_data on conversation updates. |
| packages/api/src/microsoft_teams/api/models/entity/unknown_entity.py | Introduces a new model type intended to capture unknown/forward-compatible entities. |
| packages/api/src/microsoft_teams/api/models/entity/entity.py | Adds UnknownEntity into the Entity union for parsing. |
| packages/api/src/microsoft_teams/api/models/entity/init.py | Exposes UnknownEntity as part of the public entity API. |
| packages/api/src/microsoft_teams/api/activities/conversation/conversation_update.py | Makes channel_data optional to support payloads without channelData. |
Hey @dcaayushd i believe it's some mistake, im not Microsoft staff neither related with teams.py |
|
Sorry about the wrong tag! I'll find the right maintainer to review this. |
|
@lilyydu @corinagum Could you please review this PR and approve the workflow when you have a chance? Thanks! |
Hey! Thanks for raising this fix - this requires a deeper discussion with our team. Will follow back when we reach a conclusion! |
|
Hi @dcaayushd, Upon discussion, it is correct that Python should not be marking And likewise for unknown entity types, this should not throw an error. Will leave review comments for fixes :) |
heyitsaamir
left a comment
There was a problem hiding this comment.
Overall this looks good. I think for the unknown entity type, I'd prefer introducing a fallback UnknownEntity instead though. Curious if you had a different idea.
heyitsaamir
left a comment
There was a problem hiding this comment.
Lgtm. Thanks for the contribution!
|
hey @lilyydu, this one's been approved by @heyitsaamir but needs a second review due to branch protection since he was the last to push. would you mind taking a look when you get a chance? thanks! |
Fixes #433
What changed
Why
Real Bot Framework traffic can include new entity types and sometimes skips channelData. These should not block message handling.
Tests