Msteams-docs: ConversationUpdate event for nodeJS SDK V4

Created on 28 Mar 2019  Â·  18Comments  Â·  Source: MicrosoftDocs/msteams-docs

Does the Teams client even send a conversation update event anymore? If there's any guide to get it to fire please do leave a note. Thanks!


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Most helpful comment

I ended up asking a question on stackoverflow about this, and the result was that the event is only sent the first time when a user adds it. Subsequent additions by a user do not trigger the event unless a new bot ID/app ID are generated. See https://stackoverflow.com/q/55517906/4742016

All 18 comments

As I understand the original post; it is not about handling the ConversationUpdate activity, but that the Teams client doesn't seem to send any type of activity when a user adds a bot in personal scope.

We are experiencing the same issue. A ConversationUpdate activity with MembersAdded is sent only when the bot is added to a team.
But the documentation states here that the same should happen

when a user adds it directly for personal chat

This does not seem to work.
So is this a bug in the Teams client/server? Or a misleading documentation?

Also looking for a solution to this. When my Teams bot is installed with personal scope, my server does not get any request at all from the client until the user messages it. I want to achieve similar functionality to the Hipmunk bot, which sends a message privately when it is added.

@BrendanHart @thschuetze I havent had chance to test it out, but Im pretty sure way Hipmunk accomplishes this is leveraging the microsoft teams specific functionality.

Should be able to leverage some of the microsoft teams internal apis to accomplish what you are trying to do.

https://github.com/OfficeDev/microsoft-teams-library-js/blob/master/src/internal/internalAPIs.ts

I ended up asking a question on stackoverflow about this, and the result was that the event is only sent the first time when a user adds it. Subsequent additions by a user do not trigger the event unless a new bot ID/app ID are generated. See https://stackoverflow.com/q/55517906/4742016

@BrendanHart thank you for digging into this.
IMO this should still be looked into since it is inconsistent with the behavior of the "team" scope.

@BrendanHart funny I was just about to post that I tried sideloading a new bot connector with different ID and there was an event.

Unfortunately there is no work around to this. Even hipmunk if you remove and then reload install the bot MS Teams does not register a new conversation. In MS Teams context there is no new conversation, even if you uninstall the bot the conversation persists essentially forever.

@thschuetze the "team" scope works as described. If you remove the bot from a teams channel there is an event and if you add back there is another event.

@01 Is there going to be support for the same when the bot gets added in a personal scope?

I ended up asking a question on stackoverflow about this, and the result was that the event is only sent the first time when a user adds it. Subsequent additions by a user do not trigger the event unless a new bot ID/app ID are generated. See https://stackoverflow.com/q/55517906/4742016

Isn't it impossible to generate a new App ID for an existing app? Are you saying that I need to configure a brand new integration in the Azure App portal just to test the event in the personal scope every single time?

Isn't it impossible to generate a new App ID for an existing app? Are you saying that I need to configure a brand new integration in the Azure App portal just to test the event in the personal scope every single time?

An alternative would be using a different user to install the app, but with the same user it does seem to be a one time event for a given app ID.

The Bot Emulator has the capability to send conversation update events.

Thank you everyone! @BrendanHart @01 You guys are right. It does work only the first time when someone new adds the bot again. Thanks a lot for your time.

With that being said, IMO it would be really nice if we were to receive an event when the bot is added to the personal scope and let the server figure out whether or not to welcome them again.

The Bot Emulator has the capability to send conversation update events.

Yes but the payload we receive for Teams on the personal scope is not the same as the Bot Emulator's nor is it documented anywhere as far as I have seen.

The Bot Emulator has the capability to send conversation update events.

Yes but the payload we receive for Teams on the personal scope is not the same as the Bot Emulator's nor is it documented anywhere as far as I have seen.

Ran into the same problem. The Microsoft.Bot.Connector.Teams.GetConversationUpdateData extension method threw an exception when used in 'personal' scope because the ChannelData was incomplete. It works in 'team' scope.
This is a very annoying surprise when you have only a limited number of attempts to get this right (I am running out of colleagues that haven't talked to our bot)

Just gonna leave the schema here for anyone else who's struggling with this issue. I've changed the IDs but you can just send this via POST body for debugging purposes provided you can fill in the rest of the data (Teams Scope). But as @thschuetze said, testing will be difficult as you are limited by the number of willing participants in your team.

{ "membersAdded": [ { "id": "28:<BotID>" }, { "id": "29:<userID>", "aadObjectId": "***" } ], "type": "conversationUpdate", "timestamp": "2019-04-23T10:17:44.349Z", "id": "***", "channelId": "msteams", "serviceUrl": "https://***", "from": { "id": "29:<USERID>", "aadObjectId": "***" }, "conversation": { "conversationType": "personal", "id": "***" }, "recipient": { "id": "28:<BOT ID>", "name": "<BOT NAME>" }, "channelData": { "tenant": { "id": "<TENANT ID>" } } }

I ran into this issue late last night and I'm disappointed that this isn't explained anywhere else. I've been spending all morning trying to figure out if I actually read that the conversationUpdate event was supposed to be sent in the personal scope or if I just made that up. So frustrating. Thank you all for sharing this information!

Thank you all very much for continuing to explore this issue. I've updated our documentation to hopefully address this area more fully. I'd really appreciate it if you all could take a look at the updated documentation to see if it would have alleviated the confusion around this topic. Please let me know if you think we're still missing something; direct link to docs

Was this page helpful?
0 / 5 - 0 ratings