Why I can't save my connector on Microsoft Teams?

Viewed 250

I made a custom connector for teams that display notifications on channels and add Tab on teams.

For the tab parts -> Everything is working well

But I have a problem for the connector parts, I get an error when I try to save my settings in the developer console:

Received error from connectors {"seq":1585127802210,"timestamp":1585127814174,"flightSettings":{"Name":"ConnectorFrontEndSettings","AriaSDKT....

-> registerOnSaveHandler is called -> setSettings is correctly set with entityId, contentUrl (same configurationUrl as the connector configuration) and the configName. getSettings -> is called to save to my app the webhook url -> it works -> notifySuccess is then called and

I checked on the connector dashboard everything seems fine, on the App Studio everything is green also!

I don't know what is happening..

My manifest

{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "1.0.0",
"id": "ca153ede-92f2-46e7-8695-3726b5343bf4",
"packageName": "com.kagilum.icescrum",
"developer": {
    "name": "Kagilum SAS",
    "websiteUrl": "https://www.icescrum.com",
    "privacyUrl": "https://www.icescrum.com/privacy",
    "termsOfUseUrl": "https://www.icescrum.com/termsofuser"
},
"icons": {
    "color": "color.png",
    "outline": "outline.png"
},
"name": {
    "short": "iceScrum",
    "full": "Connect with iceScrum"
},
"description": {
    "short": "A true Agile project management tool",
    "full": "iceScrum is a web application for using Scrum while keeping the spirit of a collaborative workspace. It also offers virtual boards with post-its for sprint backlog, product backlog and others."
},
"accentColor": "#FFFFFF",
"configurableTabs": [
    {
        "configurationUrl": "https://preview.icescrum.com/msTeams/setupTab/",
        "canUpdateConfiguration": true,
        "scopes": [
            "team",
            "groupchat"
        ],
        "supportedSharePointHosts": [
            "sharePointFullPage",
            "sharePointWebPart"
        ]
    }
],
"connectors": [
    {
        "connectorId": "f00d8890-daa8-4c87-89f5-83cbab0bccd4",
        "configurationUrl": "https://preview.icescrum.com/msTeams/setup/",
        "scopes": [
            "team"
        ]
    }
],
"permissions": [
    "identity",
    "messageTeamMembers"
],
"validDomains": [
    "preview.icescrum.com"
]

}

Piece of code related to

microsoftTeams.settings.registerOnSaveHandler(function(saveEvent) {
        microsoftTeams.settings.setSettings({
            entityId: 'icescrum-pkey-' + $scope.settings.project.pkey,
            contentUrl: isSettings.serverUrl + '/msTeams/setup/',
            configName: $scope.settings.project.name
        });
        microsoftTeams.settings.getSettings(function(settings) {
            $scope.settings.webhookUrl = settings.webhookUrl;
            return FormService.httpPost('msTeams/save', $scope.settings, true).then(function() {
                saveEvent.notifySuccess(); //wait that the settings are really saved on iceScrum side
            });
        });
    });
    microsoftTeams.settings.getSettings(function(settings) {
        $scope.setup = !settings.configName;
        var tokenData = JSON.parse(localStorage.getItem("msTeams-oauth"));
        var userData = JSON.parse(localStorage.getItem("msTeams-user"));
        if (tokenData) {
            FormService.httpGet('ws/project/user/' + userData.id + '?light=true', {headers: {'Authorization': 'Bearer ' + tokenData['accessToken']}}, true).then(function(projects) {
                $scope.projects = projects;
                if (settings.entityId) {
                    $scope.settings.project = _.find($scope.projects, {pkey: settings.entityId.split('icescrum-pkey-')[1]});
                }
                $scope.ready = true;
            });
        }
    });

Full error:

angular.min.js:113 2020-03-25T20:35:25.953Z Received error from connectors {"seq":1585168484680,"timestamp":1585168525943,"flightSettings":{"Name":"ConnectorFrontEndSettings","AriaSDKToken":"d127f72a3abd41c9b9dd94faca947689-d58285e6-3a68-4cab-a458-37b9d9761d35-7033","SPAEnabled":true,"ClassificationFilterEnabled":true,"ClientRoutingEnabled":true,"EnableYammerGroupOption":true,"EnableFadeMessage":false,"EnableDomainBasedOwaConnectorList":false,"EnableDomainBasedTeamsConnectorList":false,"DevPortalSPAEnabled":true,"ShowHomeNavigationButtonOnConfigurationPage":false,"DisableConnectToO365InlineDeleteFeedbackPage":true},"status":500,"clientType":"SkypeSpaces","connectorType":"f00d8890-daa8-4c87-89f5-83cbab0bccd4","name":"handleMessageError"}
2 Answers

In case this helps anyone else, I spent ages today trying to get to the bottom of this and couldn't find a solution. Until...as a last gasp show of desperation I decide to use App Studio to recreate the entire connector manifest from scratch, including creating a new connector in the portal.

For some reason, this then worked fine - even though I can see that the two manifest files are identical with the exception of the ID (and I already tried regenerating the ID for the original one).

Bit late to the story, but having followed multiple github issues like this and stack overflow posts, I'm pretty convinced that its the problem with Connectors dashboard. If you made any change to settings, they are not really propageted/saved correctly.

So for example, if you changed validDomains or configurationPage URL, they won't actually do anything. You can verify that with your devtools. For me, after changing the configurationPage the Teams is still making request to old URL as well as the new one, but the old request produces error that's listed in question.

The only workaround I was able to find is to recreate connector in dashboard. Reported problem to MS Teams dev team, waiting to hear back.

Related