From 606e30fed27723980eb4efb879ace97fb2a56a25 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 9 Apr 2021 15:24:10 +0200 Subject: [PATCH] make comment easier to read --- src/matrix/net/HomeServerRequest.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/matrix/net/HomeServerRequest.js b/src/matrix/net/HomeServerRequest.js index c059c5a6..97728c28 100644 --- a/src/matrix/net/HomeServerRequest.js +++ b/src/matrix/net/HomeServerRequest.js @@ -44,27 +44,28 @@ export class HomeServerRequest { } } }, err => { - // if this._sourceRequest is still set, the abort error came not from calling abort here + // if this._sourceRequest is still set, + // the abort error came not from calling abort here if (err.name === "AbortError" && this._sourceRequest) { // The service worker sometimes (only on Firefox, on long, large request, // perhaps it has its own timeout?) aborts the request, see #187. // When it happens, the best thing to do seems to be to retry. // - // In the service worker, we will also actively abort requests + // In the service worker, we will also actively abort all + // ongoing requests when trying to get a new service worker to activate // (this may surface in the app as a TypeError, which already gets mapped // to a ConnectionError in the request function, or an AbortError, - // depending on the browser) - // when trying to get a new service worker to activate, - // as the service worker will only be replaced when there are - // no more (fetch) events for the current one to handle. + // depending on the browser), as the service worker will only be + // replaced when there are no more (fetch) events for the + // current one to handle. // // In that case, the request function (in fetch.js) will check - // the haltRequests flag on the service worker handler, and it will - // actually not do any requests, as that would break the update process. + // the haltRequests flag on the service worker handler, and + // block any new requests, as that would break the update process. // // So it is OK to return a ConnectionError here. // If we're updating the service worker, the /versions polling will - // actually be blocked at the fetch level because haltRequests is set. + // be blocked at the fetch level because haltRequests is set. // And for #187, retrying is the right thing to do. const err = new ConnectionError(`Service worker aborted, either updating or hit #187.`); log?.catch(err);