Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When config or code changed for custom Teams app, users cannot receive messages unless reinstall the app #9892

Closed
iloveyeseul opened this issue Sep 10, 2023 · 4 comments
Assignees
Labels
TA:Infra Team Area: Infra

Comments

@iloveyeseul
Copy link

iloveyeseul commented Sep 10, 2023

Describe the bug
Our team built a custom teams app that deploys the notification bot using Azure bot service, azure function, and Teams toolkit with bot framework. We noticed that when our azure function config changes like security level changes, or major code deployed, teams adaptive card messages through the bot framework sometimes doesn't deliver to the users. We noticed that users needed to reinstall the app (sideloading at the moment) whenever main config changes or code changes and deployed in the azure function. We haven't found what is the root cause for this and wonder whether the app behaves like this when it is even published in the app catalog and for the production app. Does anyone familiar with this issue and can help?

If this happens in the production app, whenever code or config changes that deploys custom teams app, we might get tickets from the users when they stops receiving notifications and make them to uninstall/reinstall the app, which seems like an issue.

To Reproduce
Steps to reproduce the behavior:

  1. Sideload the custom Teams app
  2. Update the azure function like security level, or codes that deploys the azure bot and custom teams app
  3. Calls the azure function endpoint using postman
  4. Function call returns success but users still doesn't receive any messages from the bot
  5. Uninstall the sideloaded app, and upload zip package for app again
  6. Start to receive messages again

Expected behavior
Sideloading or installation of the app should be happened once unless there is any changes in the manifest itself. But users need to reinstall the app when they reliaze to not to receive messages from the app.

Screenshots
If applicable, add screenshots to help explain your problem.

VS Code Extension Information (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

CLI Information (please complete the following information):

  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@microsoft-github-policy-service
Copy link
Contributor

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.

@swatDong
Copy link
Contributor

@iloveyeseul - have you modified any storage-related part?
If your project was created by Teams Toolkit, it by default uses a local file storage which will be automatically cleaned up when the webapp/azfunc is restarted.
You may need to add your own persist storage (to ). See this doc for more about notification bot storage.

@iloveyeseul
Copy link
Author

Hello @swatDong , thanks for the context. I will work on the setting the persist storage. But can you elaborate more on why teams message is not delivered to the users? And the local file storage is different the azure storage account that is tied to the azure function? and if the local storage is cleaned up when function restarted, it forgot who installs the app so that users not receive message? I'm trying to connect the dots how this is the root cause issue for this.

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs attention This issue needs the attention of a contributor. label Sep 11, 2023
@swatDong
Copy link
Contributor

@iloveyeseul , as described in this doc, notification works based on the stored conversation reference, that is:

  • When user installs/messages the app
  • Bot gets the user's conversation reference and stores somewhere
  • When notification triggers
  • Bot loads the user's conversation reference from storage and send message to user

Thus, if the storage is cleaned up, bot loses the connection and cannot notify user.
The default local file storage is different from the azure storage tied to azfunc. Technically you can reuse the same storage account with different container, but you may need to add your own storage implementation. Here's a sample if you are using typescript and teamsfx 2.* package.

@adashen adashen removed needs attention This issue needs the attention of a contributor. investigating labels Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TA:Infra Team Area: Infra
Projects
None yet
Development

No branches or pull requests

3 participants