SOLVED

registerOnRemoveHandler - called but after removal there is an option to cancel it.(teams connector)

%3CLINGO-SUB%20id%3D%22lingo-sub-484608%22%20slang%3D%22en-US%22%3EregisterOnRemoveHandler%20-%20called%20but%20after%20removal%20there%20is%20an%20option%20to%20cancel%20it.(teams%20connector)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-484608%22%20slang%3D%22en-US%22%3E%3CP%20class%3D%22%22%3EWhen%20removing%20an%20msteams%20connector%20resgistered%20using%26nbsp%3B%3CSPAN%3EregisterOnRemoveHandler%2C%3C%2FSPAN%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3Ethe%20onremove%20event%20is%20called%2C%20but%20later%20there%20is%20an%20option%20to%20cancel%20the%20removal.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EBut%20this%20is%20to%20late%20as%20the%20data%20we%20store%20regarding%20to%20the%20specific%20connector%20is%20already%20removed.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20think%20this%20is%20a%20bug.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EA%20correct%20behaviour%20would%20be%20to%20call%20the%20remove%20just%20on%20the%20final%20step%20on%20the%20second%20dialog.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20do%20you%20think%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-497941%22%20slang%3D%22en-US%22%3ERe%3A%20registerOnRemoveHandler%20-%20called%20but%20after%20removal%20there%20is%20an%20option%20to%20cancel%20it.(teams%20connec%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-497941%22%20slang%3D%22en-US%22%3E%3CP%3ECurrently%2C%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CEM%3EmicrosoftTeams.settings.registerOnRemoveHandler()%3C%2FEM%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eis%20called%20whenever%20remove%20button%20is%20clicked.%20This%20is%20where%20you%20can%20do%20the%20clean%20up%20operation.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3EKnow%20issue%3C%2FEM%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-%20User%20could%20possibly%20cancel%20the%20removal%20flow%20on%20feedback%20screen%20and%20there%20is%20no%20way%20to%20know%20that.%20We%20are%20working%20on%20the%20fix.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3ECurrently%2C%20the%20workaround%20is%20to%20u%3CFONT%20face%3D%22Calibri%22%3E%3CSPAN%3Ese%20%3C%2FSPAN%3E%3CSPAN%3EWebhook%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B410%20Gone%20%3C%2FSPAN%3E%3CSPAN%3Eresponse%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3Bas%20the%20trigger%20to%20perform%20cleanup%20operations%20until%20the%20issue%20is%20fixed.%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSTRONG%3EUPDATES%3A%3C%2FSTRONG%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20face%3D%22Calibri%22%3E%3CSPAN%3E%3CSTRONG%3EThis%26nbsp%3B%3CEM%3Eknown%20issue%3C%2FEM%3E%26nbsp%3Bhas%20been%20fixed.%3C%2FSTRONG%3E%26nbsp%3BWe%20no%20longer%20show%20feedback%20screen%20when%20user%20clicks%20on%20Remove%20for%20Connector.%20You%20can%20perform%20your%20cleanup%20operations%20on%26nbsp%3B%3CEM%3EregisterOnRemoveHandler()%3C%2FEM%3Eevent%20and%20be%20sure%20that%20Connector%20has%20been%20removed.%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

When removing an msteams connector resgistered using registerOnRemoveHandler, 

the onremove event is called, but later there is an option to cancel the removal.

But this is to late as the data we store regarding to the specific connector is already removed.

 

I think this is a bug.

 

A correct behaviour would be to call the remove just on the final step on the second dialog.

 

What do you think?

1 Reply
best response confirmed by someone_developing (Occasional Contributor)
Solution

Currently, microsoftTeams.settings.registerOnRemoveHandler() is called whenever remove button is clicked. This is where you can do the clean up operation.

 

Know issue - User could possibly cancel the removal flow on feedback screen and there is no way to know that. We are working on the fix.

 

Currently, the workaround is to use Webhook 410 Gone response as the trigger to perform cleanup operations until the issue is fixed.
 
UPDATES:
 
This known issue has been fixed. We no longer show feedback screen when user clicks on Remove for Connector. You can perform your cleanup operations on registerOnRemoveHandler()event and be sure that Connector has been removed.