-
Notifications
You must be signed in to change notification settings - Fork 14
Fix App Send Targeted Messages by updating ConversationReference User #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix App Send Targeted Messages by updating ConversationReference User #210
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request fixes a bug in the App.Send() method that prevented targeted messages from being delivered correctly. The fix sets the ConversationReference.User field to activity.Recipient when sending targeted messages, enabling the sender plugin to properly configure the outgoing activity's recipient.
Key Changes
- Sets
ConversationReference.User = activity.RecipientwhenisTargeted=truein theApp.Send()method - Maintains backward compatibility by keeping
Userasnullfor non-targeted messages
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
singhk97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
/azp run |
|
No pipelines are associated with this pull request. |
|
/azp run |
|
No pipelines are associated with this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| if (isTargeted && activity.Recipient is null) | ||
| { | ||
| throw new ArgumentException("activity.Recipient is required for targeted messages"); |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ArgumentException should specify the parameter name as the second argument for better debugging and adherence to .NET conventions. Consider:
throw new ArgumentException("activity.Recipient is required for targeted messages", nameof(activity));This helps developers identify which parameter caused the exception and follows the standard pattern for ArgumentException where the second parameter specifies the problematic parameter name.
| throw new ArgumentException("activity.Recipient is required for targeted messages"); | |
| throw new ArgumentException("activity.Recipient is required for targeted messages", nameof(activity)); |
| /// </summary> | ||
| /// <param name="activity">activity activity to send</param> | ||
| /// <param name="isTargeted">when true, sends the message privately to the specified recipient; when false, sends to all conversation participants</param> | ||
| /// <param name="isTargeted">when true, sends the message privately to the specified recipient. when false, sends to all conversation participants</param> |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The punctuation in this parameter description is inconsistent with other similar isTargeted parameter descriptions in the same file (lines 251 and 274), which use a semicolon instead of a period. For consistency, consider using a semicolon:
/// <param name="isTargeted">when true, sends the message privately to the specified recipient; when false, sends to all conversation participants</param>This maintains consistency with the existing documentation style in the codebase.
| /// <param name="isTargeted">when true, sends the message privately to the specified recipient. when false, sends to all conversation participants</param> | |
| /// <param name="isTargeted">when true, sends the message privately to the specified recipient; when false, sends to all conversation participants</param> |
Problem
App.Send()cannot send targeted messages because it buildsConversationReference, dropping the requiredUserfield that specifies the recipient id for targeted messages.Fix
ConversationReference.User = activity.RecipientwhenisTargeted=trueinApp.Send()Userremainsnull)