Retrieving chat between user and app via GraphApi triggers a conversationUpdate event on the bot

Copper Contributor

Hello, I'm currently working on the welcome message for my app when an user installation pops in and so far everything works as expected, whenever the app is installed manually from the store or via GraphAPI  the bot receives the conversationUpdate activity and then sends the welcome message (code reference here).

 

Then comes the issue, whenever I use the graphApi to retrieve the chat between the user and the bot this same flow is triggered yet again resulting in another welcome message, there's no distinction between this new activity and the one triggered by the installation making it impossible to discern when to send the welcome message. The chat id is needed so my bot can send proactive messages to the user when certain things happen outside from teams.

 

Theoretically I could retrieve the list of messages in the chat using the graph api in the bot to check wether the welcome message was already triggered or not but this behaviour seems a little bit odd, is there a particular reason why retrieving the chat id triggers a conversationUpdate activity? 

3 Replies

@adriabonet - Thanks for reporting your issue. 

We have tested graphApi to retrieve the chat between the user and the bot. ConversationUpdate event was not triggered at our end.
Could you please test this again and confirm on this?
If issue still occurs, could you please share your screen recording to understand the scenario?


@Nivedipa-MSFT It seems it was a misunderstanding on my part over the events triggered in the installation flow, the one I was actually looking for and mistaking the conversationUpdate for was the installationUpdate. After following through this documentation you sent me over I managed to make it work the expected way triggering the welcome message only once the app was installed.

 

Thanks for the assistance!