From 38c0cdc360a044d1d561cdb16303109c98326df9 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 6 Apr 2020 16:42:54 +0200 Subject: [PATCH] javascript: ignore errors of attachments pooler Pooling for attachment status is a background operation. Errors should not be reported to the user, who didn't even ask for this operation to take place. This is why we ignore all errors, whether Javascript exceptions or network errors. --- app/javascript/shared/remote-poller.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/javascript/shared/remote-poller.js b/app/javascript/shared/remote-poller.js index 937810778..ffb1cb9e7 100644 --- a/app/javascript/shared/remote-poller.js +++ b/app/javascript/shared/remote-poller.js @@ -67,7 +67,9 @@ class RemotePoller { let urls = this.urls; this.reset(); for (let url of urls) { - ajax({ url, type: 'get' }); + // Start the request. The JS payload in the response will update the page. + // (Errors are ignored, because background tasks shouldn't report errors to the user.) + ajax({ url, type: 'get' }).catch(() => {}); } }