diff --git a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml
index 201ebafc4b..cceb26b442 100644
--- a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml
+++ b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml
@@ -45,7 +45,7 @@ Copyright (C) 2007 Ashley G Ramdass (ADempiere WebUI).
-
+
diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/session/SessionContextListener.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/session/SessionContextListener.java
index 881f2ddb43..785383141e 100644
--- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/session/SessionContextListener.java
+++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/session/SessionContextListener.java
@@ -250,6 +250,10 @@ public class SessionContextListener implements ExecutionInit,
}
int AD_Session_ID = Env.getContextAsInt(Env.getCtx(), Env.AD_SESSION_ID);
if (AD_Session_ID > 0) {
+
+ //sleep 1s to avoid timing issue with login and logout (both uses redirect call)
+ Thread.sleep(1000);
+
String key = getSessionDesktopListKey(AD_Session_ID);
@SuppressWarnings("unchecked")
List list = (List) Env.getCtx().get(key);
diff --git a/org.adempiere.ui.zk/WEB-INF/src/web/js/jawwa/atmosphere/serverpush.js b/org.adempiere.ui.zk/WEB-INF/src/web/js/jawwa/atmosphere/serverpush.js
index 7b7bf95783..bd746c7fe4 100644
--- a/org.adempiere.ui.zk/WEB-INF/src/web/js/jawwa/atmosphere/serverpush.js
+++ b/org.adempiere.ui.zk/WEB-INF/src/web/js/jawwa/atmosphere/serverpush.js
@@ -35,7 +35,7 @@
this.timeout = timeout;
this.ajaxOptions.data = { dtid: this.desktop.id };
this.ajaxOptions.timeout = this.timeout;
- this.ajaxOptions.url = zk.ajaxURI("/comet", {au: true,desktop:this.desktop.id,ignoreSession:false}),
+ this.ajaxOptions.url = zk.ajaxURI("/comet", {au: true,desktop:this.desktop.id,ignoreSession:true}),
this.trace = trace;
var me = this;
this.ajaxOptions.error = function(jqxhr, textStatus, errorThrown) {
@@ -43,15 +43,10 @@
console.log("error: " + textStatus + " dtid: " + me.desktop.id + " errorThrown: " + errorThrown + " status: " + jqxhr.status);
if (textStatus != "timeout" && textStatus != "abort" && errorThrown != "SessionNotFound") {
console.error("error: " + textStatus + " errorThrown: " + errorThrown + " status: " + jqxhr.status);
- //stop immediately if server is not reachable
- if (jqxhr.status == 404) {
- me.failures = 3;
- } else {
- me.failures += 1;
- }
+ me.failures += 1;
}
};
- this.ajaxOptions.success = function(data) {
+ this.ajaxOptions.success = function() {
if (me.trace)
console.log("success" + " dtid: " + me.desktop.id);
zAu.cmd0.echo(this.desktop);
@@ -72,8 +67,11 @@
},
_schedule: function() {
if (this.failures < 3) {
+ var d = this.delay;
+ if (this._req && (this._req.status == 0 || this._req.status == 400))
+ d = 500;
this._req = null;
- setTimeout(this.proxy(this._send), this.delay);
+ setTimeout(this.proxy(this._send), d);
} else {
this.stop();
jawwa.atmosphere.serverNotAvailable();
diff --git a/org.adempiere.ui.zk/index.zul b/org.adempiere.ui.zk/index.zul
index 09508cbd74..921188a30f 100644
--- a/org.adempiere.ui.zk/index.zul
+++ b/org.adempiere.ui.zk/index.zul
@@ -74,28 +74,6 @@ Copyright (C) 2007 Ashley G Ramdass.
});
});
- zk.afterLoad(function() {
- jq(window).on("unload", function () {
- //rmDesktop not call in window.onbeforeunload (mount.js) when zk.confirmClose is not null
- if (!zk.ie && zk.confirmClose){
- rmDesktop();
- }
- });
-
- //function rmDesktop duplicated from mount.js ( zk.jar 7.0.3 )
- function rmDesktop() {
- var bRmDesktop = !zk.opera && !zk.keepDesktop;
- if (bRmDesktop || zk.pfmeter) {
- try {
- var dts = zk.Desktop.all;
- for (var dtid in dts)
- zAu._rmDesktop(dts[dtid], !bRmDesktop);
- } catch (e) {
- }
- }
- }
- });
-
zk.afterLoad('zul.inp', function () {
// should filter out for only component inside standard window or component wish fire this event,