botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

OnTeamsReadReceiptAsync is never hit. There is no event to use this method.

Open cagrimunyas opened this issue 3 years ago • 7 comments

Bot framework .NET SDK has OnTeamsReadReceiptAsync and Teams App Studio offers RSC permission to receive the read receipts. However the read receipt event never arrives. Configurations:

  • Bot.cs is as following MyBot : TeamsActivityHandler.
  • 'protected override async Task OnTeamsReadReceiptAsync' method implemented under MyBot
  • Teams App manifest includes following RSC permissions:
    • ChatMessage.Read.Chat
    • ChatMessageReadReceipt.Read.Chat

With the above config. the bot never receives read receipt event. Also the documentation doesn't show any read receipt event : https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/subscribe-to-conversation-events?tabs=dotnet#conversation-update-events

To Reproduce

Steps to reproduce the behavior:

  1. Create a bot that inherits from TeamsActivityHandler
  2. Create the Teams manifest to include RSC permissions stated above.
  3. Send a message to user and make sure that user has opened the message.
  4. Monitor the incoming request on the server. (Nothing arrives regarding to read receipts)

cagrimunyas avatar Aug 21 '23 13:08 cagrimunyas

Thanks @cagrimunyas, I'm investigating.

ram-xv avatar Aug 23 '23 17:08 ram-xv

Thank you @cagrimunyas,

I'm able to reproduce this issue using sample 25.message-reaction.

In MessageReactionBot.cs, I made the following changes:

  1. Inherit from TeamsActivityHandler instead of ActivityHandlder
  2. Overrode the following OnTeamsReadReceiptAsync event handler method:
    protected override async Task OnTeamsReadReceiptAsync(
            ReadReceiptInfo readReceiptInfo,
            ITurnContext<IEventActivity> turnContext,
            CancellationToken cancellationToken
        )
        {
            string onReadMessage = "User has read the message";
            await turnContext.SendActivityAsync(onReadMessage);
        }
    
    

After the bot sends a message and the message is read in the chat, the OnTeamsReadReceiptAsync method, that overrides the event handler, is not activated.

My manifest.json testing file
  {
    "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.14/MicrosoftTeams.schema.json",
    "manifestVersion": "1.14",
    "version": "1.0.0",
    "id": "67fe6d........242af",
    "packageName": "com.teams.sample.messageReaction",
    "developer": {
      "name": "MessageReactionBot",
      "websiteUrl": "https://www.microsoft.com",
      "privacyUrl": "https://www.teams.com/privacy",
      "termsOfUseUrl": "https://www.teams.com/termsofuser"
    },
    "icons": {
      "color": "color.png",
      "outline": "outline.png"
    },
    "name": {
      "short": "MessageReactionBot",
      "full": "MessageReactionBot"
    },
    "description": {
      "short": "MessageReactionBot",
      "full": "MessageReactionBot"
    },
    "accentColor": "#FFFFFF",
    "bots": [
      {
        "botId": "67fe6d........242af",
        "scopes": [
          "groupchat",
          "team",
          "personal"
        ],
        "isNotificationOnly": false,
        "supportsCalling": false,
        "supportsVideo": false,
        "supportsFiles": false
      }
    ],
    "authorization": {
      "permissions": {
        "resourceSpecific": [
          {
            "type": "Application",
            "name": "ChatMessageReadReceipt.Read.Chat"
          },
          {
            "type": "Application",
            "name": "ChatMessage.Read.Chat"
          }
        ]
      }
    },
    "permissions": [
      "identity",
      "messageTeamMembers"
    ],
    "validDomains": [
      "*"
    ]
  }

ram-xv avatar Sep 04 '23 22:09 ram-xv

@cagrimunyas, I will let the engineers know about this and report back. Thanks!

ram-xv avatar Sep 04 '23 22:09 ram-xv

Hi @cagrimunyas,

the Teams engineers mentioned that the OnTeamsReadReceiptAsync feature hasn't been globally released as of Sep 6, 2023. We don't yet have an ETA on its availability. Given the uncertainty around the timeline, We'll be closing this issue for now.

Please feel free to reopen or create a new issue if you have further questions in the future. Thank you for your understanding!

ram-xv avatar Sep 06 '23 18:09 ram-xv

@rampaged is there any update on this?

arjavgarg avatar Feb 15 '24 19:02 arjavgarg

CC @stevkan @dmvtech

ram-xv avatar Feb 15 '24 19:02 ram-xv

@Prasad-MSFT - Are you associated with the Microsoft Teams Development team? If so, are you able to provide an update or any information to the customer regarding the OnTeamsReadReceiptAsync activity handler and if/when it might be added to the Conversation Update events list?

stevkan avatar Feb 16 '24 01:02 stevkan