microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.49k stars 2.44k forks source link

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

Closed cagrimunyas closed 1 year ago

cagrimunyas commented 1 year ago

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:

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)
InfinytRam commented 1 year ago

Thanks @cagrimunyas, I'm investigating.

InfinytRam commented 1 year ago

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 ```json { "$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": [ "*" ] } ```
InfinytRam commented 1 year ago

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

InfinytRam commented 1 year ago

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!

arjavgarg commented 7 months ago

@rampaged is there any update on this?

InfinytRam commented 7 months ago

CC @stevkan @dmvtech

stevkan commented 7 months ago

@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?