Forum Discussion

AlexK480's avatar
AlexK480
Copper Contributor
Jul 31, 2023
Solved

Teams Bot - user conversation objects are becoming stale, breaking the ability to send proactive msg

Hi, we develop a 3rd party app on the MS Teams store, which includes functionality to send proactive messages to users. The outline of the code we are using is as follows: Our deployed bot listens...
  • AlexK480's avatar
    AlexK480
    Aug 19, 2023
    Hey, we ended up working through the issue on our end - turns out the conversations were not stale after all, it was an issue with multiple tenant IDs. So you can close off the issue, the conversation objects themselves were still valid.

    As a side note, if this issue comes up for us in the future or anyone else, there is a better approach than our initial approach we tested during debugging this issue. You can save just the conversation, user, bot ids and serviceUrl (instead of the whole conversation object), and get a fresh conversation reference prior to a proactive message using BotBuilder.TurnContext.getConversationReference(conversationRefData);

Resources