OfficeDev / teams-toolkit

Developer tools for building Teams apps
Other
459 stars 189 forks source link

MS teams toolkit very slow when running debugger and custom tab app don't get added #6898

Closed Githamza closed 5 months ago

Githamza commented 1 year ago

I'm developing an app with tab and bot capabilities.

When I run the debugger ( or F5 ), the teams window popup in order to install the custom app ( for meetings ).

This process since a while does not work well: The page with the teams logo stuck for 1 or 2 minutes

After that I get in the teams app store. but the modal to install it does not show , it only stays in the store home screen.

I tried to export app.zip metadata to import it manually:

I upload the custom app.

teams add it but also the configuration custom app window does not show. the app tab does not show on the tabs list

I can't see why the problem is happening

Here's some error on my browser log console:

0.2-angular-jquery.min-14969ec.js:114 2022-11-20T09:11:02.738Z CDLWorkerManager: {"errorCode":"Unknown","requestId":"auth-1","hostRendererId":"MainRenderer","component":"CDLServer","requestRendererId":"cdlsharedworker","requestType":"auth","message":"Failed to process request due to error {\"response\":{\"name\":\"Error\",\"message\":\"AuthStateProvider not provided - This will should be an error in the RWC experience::Auth-Handler::MissingParameter\",\"stack\":[],\"context\":\"AuthStateProvider not provided - This will should be an error in the RWC experience\",\"subContext\":\"Auth-Handler\",\"code\":\"MissingParameter\"},\"status\":\"failure\"}"}
(anonymous) @ 0.2-angular-jquery.min-14969ec.js:114
e.logMessage @ 3.2-app.min-967c0de.js:1
e.error @ 3.2-app.min-967c0de.js:1
(anonymous) @ 3.4-app.min-f165fdb.js:1
e.safeWrapILoggerCall @ 3.4-app.min-f165fdb.js:1
e.error @ 3.4-app.min-f165fdb.js:1
(anonymous) @ 0.1-app-prefetch.min-d639b6e.js:1
Promise.catch (async)
(anonymous) @ 0.1-app-prefetch.min-d639b6e.js:1
Promise.then (async)
e.handleRequest @ 0.1-app-prefetch.min-d639b6e.js:1
onMessageCallback @ 0.1-app-prefetch.min-d639b6e.js:1
(anonymous) @ 0.1-app-prefetch.min-d639b6e.js:1
h.port.onmessage @ 0.1-app-prefetch.min-d639b6e.js:1
webworker-23c3e56.js:1 AI (Internal): 514 message:"SDK Initialization Failed - no telemetry will be sent: [object Error]{ stack: 'Error: Please provide instrumentation key
ghost commented 1 year ago

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.

jidddddd commented 1 year ago

Hi @Githamza, thanks for reporting the issue! Could you help provide some more details on the process you went through to create your app? Did you start with a Teams Toolkit sample or did you started with a new Tab app?

Githamza commented 1 year ago

I have tried to provide details in me initial post but not easy because I don't where the issue comes from

I have started the Hello_World_Tab_with_Backend sample app from the tookit catalog

Then I used Azure serverless functions to build my backend.

It's not easy to reproduce the problem.

What I have done recently is to start the same sample of Hello_World_Tab_with_Backend example app. then move my api + react src folders to the new repository.

That worked well : I can add my app to teams quicky and my tab is added to the meeting channel/chat .

Today I noticed that I'm running again to the same problem. slow F5 debugging: the teams app / web app is freezing when I launch debugger.

And the tab is not added as before ( the configure tab is not popin-up app also ).

I feel that the problem comes when I run many times the F5 debugger.. ( is it a problem on the back office teams toolkit server if there is one. )

I don't know how to give more informations here , may be a quick demo via a meeting could be more helpful to understand the issue

jidddddd commented 1 year ago

@Githamza Let's set up a meeting to look at this issue, feel free to email me (address in my profile).

quinndumala commented 1 year ago

Hey @jidddddd, was there a resolution to this? I'm experiencing lag as well when I debug my HelloWorld Bot app from the samples repository. It can take up to 8 minutes from pressing F5 to when the Teams instance is actually usable and responsive. The catch though is it only slows down after I've debugged the project an x number of times. I've relied mostly on hot reload to circumvent this but some changes do require the debugger to restart.

I'm wondering if there's some sort of cache I could clear from the bot or maybe within the project itself to fix this lag since deleting and cloning the repository again (which creates a new bot) temporarily resolves the lag.

Any insight would be greatly appreciated. Thank you.

jidddddd commented 1 year ago

@quinndumala What's the behavior you see during the 8mins? Does the process get stuck somewhere (e.g. browser shows a blank page or loading icon for a long time)?

quinndumala commented 1 year ago

@jidddddd It pretty much goes through how it normally would but just way slower. Hitting debug, the browser with the Teams instance opens pretty instantly but it just crawls from there. It's a solid two minutes where it's nothing but the splash screen with the Teams logo. Then the Apps tab of Teams is finally loaded in and the interface with the Add button pops up minutes more later. The Add button itself is not yet clickable for a couple more minutes and sometimes the modal does not show up at all, requiring another restart of the debugger.

When the Add button is finally clicked, it displays the spinner within the button while the bot conversation is loaded in the background, this step probably takes the longest. After all that is loaded then I can actually start debugging the app. Triggering the action commands is also a bit slow initially but gets more adquate a couple minutes in.

jidddddd commented 1 year ago

@quinndumala This is a known issue with Teams client, we are working closely with the Teams client team to investigate it, I'll ping back here once there's a solution.

omarraja786 commented 1 year ago

Any update regarding this? My app was running fine, now suddenly it is also taking forever to debug locally to get to the app install page.

Githamza commented 1 year ago

Have you tried to disable all breakpoints when launching debug ?

omarraja786 commented 1 year ago

Have you tried to disable all breakpoints when launching debug ?

Unbelievable. That solved the issue. Thank you so much. I didn't know I even had any breakpoints anywhere but why on earth does it affect the performance that much..

lifan0127 commented 5 months ago

I recently started to use the Python version of botbuilder + Teams AI in Teams Toolkit and suffered this issue. The speed is still noticeably slower than NodeJS even without any breakpoints.

MuyangAmigo commented 5 months ago

@lifan0127 Do you mind opening a new issue for us and let us know a few more details to help us trouble-shoot such as your dev environment set up and how much time it took?