Skip to content
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

In Microsoft Teams, <Conversation>.ReplyToActivity does not send a reply, it creates a new message to the conversation #6626

Open
14 tasks
tomorgan opened this issue Dec 8, 2023 · 4 comments
Labels
Area: Teams The issue is related to Teams support bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.

Comments

@tomorgan
Copy link

tomorgan commented Dec 8, 2023

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Version

Microsoft.Bot.Builder 4.21.2 .NET SDK

Describe the bug

The ConnectorClient.Conversations object has a method, SendToConversation(Async), which is used to send new message threads into a conversation. (a conversation in this instance could be 1:1 conversation with a user, or a channel chat). The method accepts an activity object and a conversation ID, and returns an Activity ID of the newly created activity.
There is also a ReplyToActivityAsync method, which takes a single parameter, an Activity object. However, even when a message has a valid ReplyToID value, the reply is sent to Microsoft Teams as a new message, not a threaded reply.
There is also a ConversationExtension method ReplyToActivityAsync, which exhibits the same behaviour.

To Reproduce

  1. Create a new activity, using a ReplyToId of an existing activity that has previously been sent to Microsoft Teams, using the existing activity ID and conversation ID where the original message was sent:
    IMessageActivity newMessage = Activity.CreateMessageActivity();
    newMessage.Type = ActivityTypes.Message;
    newMessage.Text = messageText;
    newMessage.ReplyToId = {activity_id};
    newMessage.Conversation = new ConversationAccount();
    newMessage.Conversation.Id = {conversation_id};
  2. Use ReplyToActivityAsync to send the message:
    var response = await connector.Conversations.ReplyToActivityAsync((Activity)message);
  3. Message is sent to Microsoft Teams as a new message, not as a threaded reply. No error is produced. This is most obvious in channel conversations, which can have multiple concurrent conversations happening at any one time.

Expected behavior

The message should be sent as a threaded reply to the provided activity.

Tracking Status

Dotnet SDK TODO

  • PR
  • Merged

Javascript SDK TODO

  • PR
  • Merged

Python SDK TODO

  • PR
  • Merged

Java SDK TODO

  • PR
  • Merged

Samples TODO

  • PR
  • Merged

Docs TODO

  • PR
  • Merged

Tools TODO

  • PR
  • Merged
@tomorgan tomorgan added bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team. labels Dec 8, 2023
@patst
Copy link

patst commented Jan 11, 2024

looks like this feature request? https://techcommunity.microsoft.com/t5/teams-developer/how-to-send-a-message-to-a-thread-reply-using-botbuilder-4-0-sdk/m-p/3716974

I think this bug / missing feature is very annoying, especially since we make heavy use of group chats.

@tomorgan
Copy link
Author

tomorgan commented Jan 13, 2024

I think it's probably the same code, albeit a different usage scenario. In the other example, there was (I think) a 1-2-1 conversation between a user and a bot, where the OP wanted to perform a threaded reply.
In my example, it's a channel conversation where I want to perform a standard reply to a channel post, rather than starting a new post.
Quite possibly the code path is the same though.

But also - I would argue that the presence in the SDK of a ReplyToActivityAsync method, which does not actually perform a reply, is a bug and not a missing feature!

@AlexOSIT
Copy link

AlexOSIT commented Mar 7, 2024

In hope this saves someone some time, we got replies working like this:
connector.Conversations.SendToConversationAsync($"{groupChatId};messageid={conversationId}", (Activity) message);

@tracyboehrer tracyboehrer added the Area: Teams The issue is related to Teams support label Mar 19, 2024
@dan-schroeder
Copy link

Anxiously waiting to see something happen with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Teams The issue is related to Teams support bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.
Projects
None yet
Development

No branches or pull requests

5 participants