1
votes

We have built an Excel Task Pane add-in that interacts with our server to get data from an external source. For few calls the server takes more than a minute to respond. For such calls, Excel add-in (which runs in Mac Desktop Excel 2016) doesn't receive any response (either success or failure or timeout) even though the server has sent it.

Note: This happens only when the add-in runs in Mac Desktop Excel. In other systems and browsers it works fine.

Does the Office for Mac client have a low timeout threshold? If so, is there a way to increase it? Is there any other workaround for this?

1
Can you try to reformat the question without linking to personal cloud stuff. Stackoverflow can't rely on your personal documents. - bibi
If you try the same code in Safari, what happens there? Let's isolate whether it's an Add-in or Mac browser issue. - Michael Zlatkovsky - Microsoft
@MichaelZlatkovsky tested on Mac safari, it works fine without timeouts. - Kauser
The issue is demonstrated in a sample app here: 1drv.ms/f/s!AkR0pKvDAOt3gQTvH39FVVwfrLlh In this app, request to server can be made by clicking on the button "Make request to server". The server waits for 73800ms and then responds. But the client running in Mac doesn't receive it. - Kauser
OK. Let me report the issue to the team, and see if someone can get back to you. - Michael Zlatkovsky - Microsoft

1 Answers

0
votes

The WebKit control that we use to host the add-in does not provide a way for us to override the default timeout for web requests. The default timeout is 60 seconds on Mac. If you need to have a request longer than 60 seconds I have verified that WebKit respects the XMLHttpRequest's timeout property on OSX 10.11.5. This request will not timeout for 120 seconds:

var xhr = new XMLHttpRequest();
var startDate = new Date();
xhr.open('GET', url, true);

xhr.timeout = 120000; // time in milliseconds

xhr.onload = function () {
  console.log((new Date() - startDate) + " milliseconds to return.");
};

xhr.ontimeout = function (e) {
  console.error("error");
};

xhr.send(null);

Note that this is not working starting in mac OS Sierra 10.12.1. There seems to have been a regression in WebKit. A tracking bug is opened here: https://bugs.webkit.org/show_bug.cgi?id=163814.