OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
685 stars 95 forks source link

Shared runtime Excel Addin with webpage using SignalR stops Excel from shutting down correctly #2701

Closed anthonypcole closed 7 months ago

anthonypcole commented 2 years ago

Message from office-js bot: We’re closing this issue because it has been inactive for a long time. We’re doing this to keep the issues list manageable and useful for everyone. If this issue is still relevant for you, please create a new issue. Thank you for your understanding and continued feedback.

Provide required information needed to triage your issue

Using a background signalR connection with the shared runtime enabled, I noticed that the excel process no longer immediately terminates for me after closing excel. It takes about 2 minutes or so before it seems excel realizes it should kill the JavaScript runtime and the excel process exists.

When its not in shared runtime mode, Excel shuts down immediately. When in shared runtime mode if I close all workbooks with the browser debugging tools I can SignalR is still executing timer functions, but any timers I setup myself all no longer fire, making me think somehow the js shutdown logic can't stop SignalR properly.

Your Environment

Expected behavior

After closing all workbooks, the Excel.exe process should immediately exist

Current behavior

Excel.exe stays running for about 2 minutes and then eventually exists. Launching excel again when another is trying to shutdown causes big problems for ad-ins, no vba ad-ins will load at all etc and this makes it appear that our ad-in has a bug to users so this isn't something we can let through.

Steps to reproduce

  1. Create a new shared run time excel add-in that connects to a local dotnet process
  2. Add a signalr connection in the web page that connects to the local server
  3. Launch Excel, use the side bar web page with signalR a bit
  4. Close all workbooks, watch the excel process does not exist for 2 minutes

Link to live example(s)




Provide additional details




Context

Launching excel again when another is trying to shutdown causes big problems for ad-ins, no vba ad-ins will load at all etc and this makes it appear that our ad-in has a bug to users so this isn't something we can let through.

Useful logs

Thank you for taking the time to report an issue. Our triage team will respond to you in less than 72 hours. Normally, response time is <10 hours Monday through Friday. We do not triage on weekends.

ElizabethSamuel-MSFT commented 2 years ago

@madhavagrawal17 Can you look into this? Thanks.