microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

cagrimunyas opened this issue · 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)

Thanks @cagrimunyas, I'm investigating.

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": [
      "*"
    ]
  }

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

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!