bgriffin-zenhub / core

Source Code for dotCMS Java Enterprise Content Management System
http://dotcms.com
GNU General Public License v3.0
0 stars 0 forks source link

JavaScript call to check notifications should fail more gracefully #191

Open brentgriffin opened 8 years ago

brentgriffin commented 8 years ago

Issue by brentgriffin Tuesday Mar 08, 2016 at 19:16 GMT Originally opened as https://github.com/dotCMS/core/issues/8727


Issue surfaced in support forum: https://groups.google.com/forum/#!topic/dotcms/W_xnd8tbqps

In this case the user was no longer signed into the backend but still had a browser tab open with the backend javascript still running. Every 5 seconds, 401 error is logged because the javascript call fails every time with the same error.

Fix suggested by Santo: The ideal situation would be that after the first call that get the 401 status code, the JavaScript would stop making endless attempts.

/dotcms324/dotserver/tomcat-8.0.18/webapps/ROOT/html/common/nav_sub_inc.jsp From: window.setInterval(function(){ checkNotifications(); }, 5000); TO: notificationsTimer = setInterval(function(){ checkNotifications(); }, 5000);

/dotcms324/dotserver/tomcat-8.0.18/webapps/ROOT/html/common/notifications_inc.jsp From: error : function(error) { console.log(error); } TO: error : function(error) { console.log(error); clearInterval(notificationsTimer); }

Solved, thanks!

brentgriffin commented 8 years ago

Comment by wezell Tuesday Mar 08, 2016 at 20:07 GMT


There is a card on this @brent

brentgriffin commented 8 years ago

Comment by brentgriffin Tuesday Mar 08, 2016 at 21:44 GMT


The only one I could find is this one: https://dotcms.mingle.thoughtworks.com/projects/dotcms/cards/286

But that is something different.