From b5678d74a29023cbeb3d65c0d7f57d20f47ebef9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 9 Sep 2013 01:24:20 -0400 Subject: [PATCH] webapp: Improve javascript's handling of longpolling connection failures, by reloading the current page in this case. Works around chromium behavior where ajax connections to urls that were already accessed are denied after navigating back to a previous page. --- debian/changelog | 5 +++++ ...licking_back_in_the_web_browser_crashes.mdwn | 2 ++ templates/notifications/longpolling.julius | 2 +- templates/page.julius | 17 ----------------- 4 files changed, 8 insertions(+), 18 deletions(-) delete mode 100644 templates/page.julius diff --git a/debian/changelog b/debian/changelog index 17e7fa7a50..6a5150eb8f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,11 @@ git-annex (4.20130828) UNRELEASED; urgency=low * Added gcrypt support. This combines a fully encrypted git repository (using git-remote-gcrypt) with an encrypted git-annex special remote. + * webapp: Improve javascript's handling of longpolling connection + failures, by reloading the current page in this case. + Works around chromium behavior where ajax connections to urls + that were already accessed are denied after navigating back to + a previous page. -- Joey Hess Tue, 27 Aug 2013 11:03:00 -0400 diff --git a/doc/bugs/clicking_back_in_the_web_browser_crashes.mdwn b/doc/bugs/clicking_back_in_the_web_browser_crashes.mdwn index 8d5b148bff..1b7e2ec715 100644 --- a/doc/bugs/clicking_back_in_the_web_browser_crashes.mdwn +++ b/doc/bugs/clicking_back_in_the_web_browser_crashes.mdwn @@ -19,3 +19,5 @@ When I click on the "back" button in my web browser, I get the following error m ### Please provide any additional information below. Click "forward" actually brings us back to sanity, and the webapp doesn't actually *crash*. -- [[anarcat]] + +> I have applied the page reload fix/hack. [[done]] --[[Joey]] diff --git a/templates/notifications/longpolling.julius b/templates/notifications/longpolling.julius index a85ec9c39f..ab08f8d429 100644 --- a/templates/notifications/longpolling.julius +++ b/templates/notifications/longpolling.julius @@ -3,7 +3,7 @@ $(function() { var f = function() { longpoll(url, #{ident} , function() { setTimeout(f, #{delay}); } - , function() { webapp_disconnected(); } + , function() { window.location.reload(true); } ); }; setTimeout(f, #{startdelay}); diff --git a/templates/page.julius b/templates/page.julius deleted file mode 100644 index a9d0b42239..0000000000 --- a/templates/page.julius +++ /dev/null @@ -1,17 +0,0 @@ -connfailed = - '' ; - -function webapp_disconnected () { - $('#modal').replaceWith(connfailed); - $('#modal').modal('show'); - - // ideal, but blocked by many browsers - window.close(); -}