[Fix]: sync invoke activity Value property to base for access across type hierarchy#340
Merged
MehakBindra merged 2 commits intomainfrom Feb 26, 2026
Merged
[Fix]: sync invoke activity Value property to base for access across type hierarchy#340MehakBindra merged 2 commits intomainfrom
MehakBindra merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical property shadowing bug where accessing InvokeActivity.Value through a base class reference returns null even when the derived class's Value property is populated. The fix converts auto-implemented properties using the new keyword into explicit properties with get/set accessors that sync with the base class's Value property, ensuring the value is accessible regardless of whether the activity is accessed through the derived type or base type reference.
Changes:
- Converted 18 derived activity class Value properties from auto-properties to explicit get/set properties that sync with base.Value
- Added comprehensive tests for 3 representative activity hierarchies (AdaptiveCards, Tasks, MessageExtensions) to verify the fix
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Libraries/Microsoft.Teams.Api/Activities/Invokes/AdaptiveCards/ActionActivity.cs | Fixed property shadowing for AdaptiveCards.ActionActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/HandoffActivity.cs | Fixed property shadowing for HandoffActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/SearchActivity.cs | Fixed property shadowing for SearchActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/Messages/SubmitActionActivity.cs | Fixed property shadowing for Messages.SubmitActionActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/MessageExtensions/AnonQueryLinkActivity.cs | Fixed property shadowing for MessageExtensions.AnonQueryLinkActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/MessageExtensions/FetchTaskActivity.cs | Fixed property shadowing for MessageExtensions.FetchTaskActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/MessageExtensions/QueryActivity.cs | Fixed property shadowing for MessageExtensions.QueryActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/MessageExtensions/QueryLinkActivity.cs | Fixed property shadowing for MessageExtensions.QueryLinkActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/MessageExtensions/QuerySettingUrlActivity.cs | Fixed property shadowing for MessageExtensions.QuerySettingUrlActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/MessageExtensions/SettingActivity.cs | Fixed property shadowing for MessageExtensions.SettingActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/MessageExtensions/SubmitActionActivity.cs | Fixed property shadowing for MessageExtensions.SubmitActionActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/SignIn/TokenExchangeActivity.cs | Fixed property shadowing for SignIn.TokenExchangeActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/SignIn/VerifyStateActivity.cs | Fixed property shadowing for SignIn.VerifyStateActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/Tabs/FetchActivity.cs | Fixed property shadowing for Tabs.FetchActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/Tabs/SubmitActivity.cs | Fixed property shadowing for Tabs.SubmitActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/Tasks/FetchActivity.cs | Fixed property shadowing for Tasks.FetchActivity.Value |
| Libraries/Microsoft.Teams.Api/Activities/Invokes/Tasks/SubmitActivity.cs | Fixed property shadowing for Tasks.SubmitActivity.Value |
| Tests/Microsoft.Teams.Api.Tests/Activities/Invokes/AdaptiveCards/AdaptiveCardsTests.cs | Added tests verifying Value is accessible from both derived and base types for AdaptiveCards |
| Tests/Microsoft.Teams.Api.Tests/Activities/Invokes/MessageExtensions/MessageExtensionsTests.cs | Added tests verifying Value is accessible from both derived and base types for MessageExtensions |
| Tests/Microsoft.Teams.Api.Tests/Activities/Invokes/Tasks/TasksTests.cs | Added tests verifying Value is accessible from both derived and base types for Tasks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
singhk97
approved these changes
Feb 25, 2026
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.
Fixes #339
Refactoring of
Valueproperty implementationValueproperty in multiple activity classes (e.g.,ActionActivity,HandoffActivity,AnonQueryLinkActivity,FetchTaskActivity,QueryActivity,QueryLinkActivity,QuerySettingUrlActivity,SettingActivity,SubmitActionActivity,SearchActivity,TokenExchangeActivity,VerifyStateActivity,FetchActivityin Tabs and Tasks, andSubmitActivityin Tabs and Tasks) to use explicit getter and setter methods that interact with the base class property, ensuring correct casting and assignment. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]Test improvements
Valueproperty is accessible and correctly typed both from derived activity types and from their base types for AdaptiveCards, MessageExtensions, and Tasks activities. [1] [2] [3] [4] [5] [6]E2E Test: