[PATCH] [Wok] BugFix - session timeout dialog on login

From: peterpennings <peterpnns@gmail.com> This patch fixes the quickly appears of the session timeout dialog on successful login peterpennings (2): Wok BugFix - session message appearing on login ui/js/src/wok.api.js | 3 + 1 file changed, 23 insertions(+) -- 2.5.0

From: peterpennings <peterpnns@gmail.com> Signed-off-by: peterpennings <peterpnns@gmail.com> --- ui/js/src/wok.api.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/js/src/wok.api.js b/ui/js/src/wok.api.js index e2829ab..2c3206c 100644 --- a/ui/js/src/wok.api.js +++ b/ui/js/src/wok.api.js @@ -43,6 +43,9 @@ var wok = { settings['wok'] = true; settings['complete'] = function(req) { wok.session.remainingSessionTime = req.getResponseHeader('Session-Expires-On'); + if (wok.session.remainingSessionTime == null) { + wok.session.remainingSessionTime = 30; + } wok.session.remainingSessionTime = (parseInt(wok.session.remainingSessionTime, 10) * 1000); if (!wok.session.flagInTimer) { wok.session.refreshExpiringCounter(); -- 2.5.0

Reviewed-By: Ramon Medeiros <ramonn@br.ibm.com> On 08/02/2016 05:22 PM, peterpnns@gmail.com wrote:
From: peterpennings <peterpnns@gmail.com>
Signed-off-by: peterpennings <peterpnns@gmail.com> --- ui/js/src/wok.api.js | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/ui/js/src/wok.api.js b/ui/js/src/wok.api.js index e2829ab..2c3206c 100644 --- a/ui/js/src/wok.api.js +++ b/ui/js/src/wok.api.js @@ -43,6 +43,9 @@ var wok = { settings['wok'] = true; settings['complete'] = function(req) { wok.session.remainingSessionTime = req.getResponseHeader('Session-Expires-On'); + if (wok.session.remainingSessionTime == null) { + wok.session.remainingSessionTime = 30; + } wok.session.remainingSessionTime = (parseInt(wok.session.remainingSessionTime, 10) * 1000); if (!wok.session.flagInTimer) { wok.session.refreshExpiringCounter();
-- Ramon Nunes Medeiros Kimchi Developer Linux Technology Center Brazil IBM Systems & Technology Group Phone : +55 19 2132 7878 ramonn@br.ibm.com

My first comment is that I see this session message every time I open the login window (access wokd URL). I think it has something to do with the brief opening of the User Log view for like 1 second before showing the login window. It is easily reproducible: just open wok URL without logging in. You'll see the User Log + this session message flashing for a moment every time. I am saying this because you patch is trying to fix the issue when logging in and, perhaps, we can look at this scenario pre-login as well (don't need to be in this same patch). More comments below. On 08/02/2016 05:22 PM, peterpnns@gmail.com wrote:
From: peterpennings <peterpnns@gmail.com>
Signed-off-by: peterpennings <peterpnns@gmail.com> --- ui/js/src/wok.api.js | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/ui/js/src/wok.api.js b/ui/js/src/wok.api.js index e2829ab..2c3206c 100644 --- a/ui/js/src/wok.api.js +++ b/ui/js/src/wok.api.js @@ -43,6 +43,9 @@ var wok = { settings['wok'] = true; settings['complete'] = function(req) { wok.session.remainingSessionTime = req.getResponseHeader('Session-Expires-On'); + if (wok.session.remainingSessionTime == null) { + wok.session.remainingSessionTime = 30; + }
I don't like how we are hardcoding the '30'. These are the instances I've found of this timer (with your patch applied): [danielhb@arthas src]$ grep -R '30' . ./wok.session.js: remaingTimeToShowAlert: 30000, ./wok.session.js: $("#session-expiring-alert p").html("<script>var message = i18n['WOKSESS0001M'].replace('%1', 30);" ./wok.session.js: + "var n = 30;" ./wok.api.js: wok.session.remainingSessionTime = 30; [danielhb@arthas src]$ We need to put this 30 in a variable to be accessible by all these instances. Otherwise any change of this timer will require searching for every hardcoded instance of it. Daniel
wok.session.remainingSessionTime = (parseInt(wok.session.remainingSessionTime, 10) * 1000); if (!wok.session.flagInTimer) { wok.session.refreshExpiringCounter();

On 08/03/2016 10:51 AM, Daniel Henrique Barboza wrote:
My first comment is that I see this session message every time I open the login window (access wokd URL). I think it has something to do with the brief opening of the User Log view for like 1 second before showing the login window. It is easily reproducible: just open wok URL without logging in. You'll see the User Log + this session message flashing for a moment every time.
Hi Daniel, I could not see the issue you said when accessing the login page. I can only see the issue right after the login.
I am saying this because you patch is trying to fix the issue when logging in and, perhaps, we can look at this scenario pre-login as well (don't need to be in this same patch).
More comments below.
On 08/02/2016 05:22 PM, peterpnns@gmail.com wrote:
From: peterpennings <peterpnns@gmail.com>
Signed-off-by: peterpennings <peterpnns@gmail.com> --- ui/js/src/wok.api.js | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/ui/js/src/wok.api.js b/ui/js/src/wok.api.js index e2829ab..2c3206c 100644 --- a/ui/js/src/wok.api.js +++ b/ui/js/src/wok.api.js @@ -43,6 +43,9 @@ var wok = { settings['wok'] = true; settings['complete'] = function(req) { wok.session.remainingSessionTime = req.getResponseHeader('Session-Expires-On'); + if (wok.session.remainingSessionTime == null) { + wok.session.remainingSessionTime = 30; + }
I don't like how we are hardcoding the '30'. These are the instances I've found of this timer (with your patch applied):
[danielhb@arthas src]$ grep -R '30' . ./wok.session.js: remaingTimeToShowAlert: 30000, ./wok.session.js: $("#session-expiring-alert p").html("<script>var message = i18n['WOKSESS0001M'].replace('%1', 30);" ./wok.session.js: + "var n = 30;" ./wok.api.js: wok.session.remainingSessionTime = 30; [danielhb@arthas src]$
We need to put this 30 in a variable to be accessible by all these instances. Otherwise any change of this timer will require searching for every hardcoded instance of it.
Daniel
wok.session.remainingSessionTime = (parseInt(wok.session.remainingSessionTime, 10) * 1000); if (!wok.session.flagInTimer) { wok.session.refreshExpiringCounter();
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

Hi Peter, I could not see any difference with this patch. I keep seeing the dialog right after the login for a second in the screen. I used the build-all.sh script to rebuild the code to test. Maybe something else is missing... Regards, Aline Manera On 08/02/2016 05:22 PM, peterpnns@gmail.com wrote:
From: peterpennings <peterpnns@gmail.com>
This patch fixes the quickly appears of the session timeout dialog on successful login
peterpennings (2): Wok BugFix - session message appearing on login
ui/js/src/wok.api.js | 3 +
1 file changed, 23 insertions(+)
participants (4)
-
Aline Manera
-
Daniel Henrique Barboza
-
peterpnns@gmail.com
-
Ramon Medeiros