From c082564c66a54c20f325ced4c5cc7034e02df6e9 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 17 Jan 2017 17:09:27 -0800 Subject: [PATCH] reload: Catch exceptions aborting pending AJAX requests. It's probably a bug that this throws exceptions sometimes, but it's not consistently reproducible (or maybe, browser dependent?), and it isn't really a problem to fail to abort some requests as part of the page reload process; the abort was just there to make sure as little as possible is happening so we can garbage-collect effectively. --- static/js/reload.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/js/reload.js b/static/js/reload.js index ec18078737..8c7809d703 100644 --- a/static/js/reload.js +++ b/static/js/reload.js @@ -145,7 +145,12 @@ function cleanup_before_reload() { $('*').off(); // Abort all pending ajax requests` - channel.abort_all(); + try { + channel.abort_all(); + } catch (ex) { + // This seems to throw exceptions for no apparent reason sometimes + blueslip.debug("Error aborting XHR requests on reload; ignoring"); + } // Free all the DOM in the main_div $("#main_div").empty();