microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove app from personal scope

jnaglis opened this issue · comments

Describe the bug

When app is removed from personal scope OnTeamsMembersRemovedAsync is not called.
In some cases has been observed that also OnInstallationUpdateAddAsync and OnTeamsMembersAddedAsync called after removing app from personal scope.

To Reproduce

Steps to reproduce the behavior:

  1. Install app to personal scope by uploading manifest
  2. Remove app from personal scope

Expected behavior

OnMembersRemovedAsync called after app removed from personal scope. And not OnInstallationUpdateAddAsync and OnTeamsMembersAddedAsync.

Thanks @jnaglis, I'm looking into this.

Hi @jnaglis,

are you removing the app in Teams application or Teams Admin Center portal?

Hi @ramfattah,
In Teams application.

Hi @jnaglis,

For uninstallation in the personal scope, the "Install update event" is triggered, aligning with the official Teams documentation. It appears this behavior is by design.

Please refer to the Uninstall behavior for personal app with bot for more details.

Example:

protected override async Task OnInstallationUpdateActivityAsync(ITurnContext<IInstallationUpdateActivity> turnContext, CancellationToken cancellationToken)
{
    var activity = turnContext.Activity;
    if (string.Equals(activity.Action, "Add", StringComparison.InvariantCultureIgnoreCase))
    {
        // TO:DO Installation workflow.
    }
    else
    {
        // TO:DO Uninstallation workflow.
    }
    return;
}