Skip to content

Conversation

@ShanmathiMayuramKrithivasan
Copy link
Contributor

Problem

App.Send() cannot send targeted messages because it builds ConversationReference, dropping the required User field that specifies the recipient id for targeted messages.

Fix

  • Set ConversationReference.User = activity.Recipient when isTargeted=true in App.Send()
  • This ensures the sender plugin can properly set the outgoing activity's recipient
  • Maintains backward compatibility for non-targeted messages (User remains null)

Copilot AI review requested due to automatic review settings November 21, 2025 13:53
Copilot finished reviewing on behalf of ShanmathiMayuramKrithivasan November 21, 2025 13:56
Copy link
Contributor

Copilot AI left a 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.Recipient when isTargeted=true in the App.Send() method
  • Maintains backward compatibility by keeping User as null for non-targeted messages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 24, 2025 05:39
Copilot finished reviewing on behalf of ShanmathiMayuramKrithivasan November 24, 2025 05:41
Copy link
Contributor

Copilot AI left a 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
singhk97 previously approved these changes Nov 24, 2025
Copy link
Collaborator

@singhk97 singhk97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rido-min
Copy link
Member

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@rido-min
Copy link
Member

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

Copilot AI review requested due to automatic review settings November 24, 2025 19:51
Copilot finished reviewing on behalf of rido-min November 24, 2025 19:54
Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

singhk97
singhk97 previously approved these changes Dec 1, 2025
Copilot AI review requested due to automatic review settings December 4, 2025 04:28
Copilot finished reviewing on behalf of ShanmathiMayuramKrithivasan December 4, 2025 04:30
Copy link
Contributor

Copilot AI left a 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");
Copy link

Copilot AI Dec 4, 2025

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.

Suggested change
throw new ArgumentException("activity.Recipient is required for targeted messages");
throw new ArgumentException("activity.Recipient is required for targeted messages", nameof(activity));

Copilot uses AI. Check for mistakes.
/// </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>
Copy link

Copilot AI Dec 4, 2025

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.

Suggested change
/// <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 uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants