[FIX] bus: prevent error popups when longpolling requests are interrupted
authorOlivier Dony <odo@openerp.com>
Mon, 22 Sep 2014 17:13:41 +0000 (19:13 +0200)
committerOlivier Dony <odo@openerp.com>
Mon, 22 Sep 2014 17:14:57 +0000 (19:14 +0200)
1b9c404 modified the /longpolling/poll requests
to use openerp.session.rpc() instead of openerp.jsonRpc().
In order to properly disable error popups, an
explicit preventDefault() call is now required.

addons/bus/static/src/js/bus.js

index 26dbb69..6ca515f 100644 (file)
@@ -33,6 +33,8 @@
                     self.poll();
                 }
             }, function(unused, e) {
+                // no error popup if request is interrupted or fails for any reason
+                e.preventDefault();
                 // random delay to avoid massive longpolling
                 setTimeout(_.bind(self.poll, self), bus.ERROR_DELAY + (Math.floor((Math.random()*20)+1)*1000));
             });