Openbravo Issue Tracking System - Retail Modules
View Issue Details
0047024Retail ModulesWeb POSpublic2021-06-08 14:132021-08-12 09:26
jetxarri 
ranjith_qualiantech_com 
highminoralways
closedfixed 
5
 
RR20Q3.4RR21Q3 
No
0047024: Session timeout is not working properly
Session timeout is not working properly. The session timeout is only removed and created a new one when enyo.gesture.down is executed and this is not true.

For example if the user read a barcode, the timer should be reseted.
-configure preference "Web POS Session Timeout" to 1 minute
-login into Web POS
-do nothing for 30 seconds
-read a barcode
-after 30 second the session is over and lock is happening
Remove current timeout
org.openbravo.retail.posterminal/web/org.openbravo.retail.posterminal/js/login/model/login-model.js --> setTerminalLockTimeout(

And create more global. For example

function setTerminalLockTimeout(
      sessionTimeoutMinutes,
      sessionTimeoutMilliseconds
    ) {
      OB.debug(
        'Terminal lock timer reset (' + sessionTimeoutMinutes + ' minutes)'
      );
      clearTimeout(OB.NORCUS.timeoutId);
      OB.NORCUS.timeoutId = setTimeout(function() {
        OB.warn(
          'The terminal was not used for ' +
            sessionTimeoutMinutes +
            ' minutes. Locking the terminal'
        );
        OB.MobileApp.model.lock();
      }, sessionTimeoutMilliseconds);
    }

    var sessionTimeoutMinutes = OB.MobileApp.model.get('terminal')
      .sessionTimeout;

    if (sessionTimeoutMinutes) {
      const sessionTimeoutMilliseconds = sessionTimeoutMinutes * 60 * 1000;

      const renewTimer = () => {
        setTerminalLockTimeout(
          sessionTimeoutMinutes,
          sessionTimeoutMilliseconds
        );
      };
      // set the terminal lock timeout
      renewTimer();

      window.document.ontouchend = _.debounce(renewTimer, 250);
      window.document.onkeypress = _.debounce(renewTimer, 250);
      window.document.onclick = _.debounce(renewTimer, 250);
    }
NOR
Issue History
2021-06-08 14:13jetxarriNew Issue
2021-06-08 14:13jetxarriAssigned To => Retail
2021-06-08 14:13jetxarriTriggers an Emergency Pack => No
2021-06-08 14:14jetxarriTag Attached: NOR
2021-06-08 21:34rafarodaResolution time => 1623967200
2021-06-16 17:42marvintmResolution time1623967200 => 1624572000
2021-06-21 06:18ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2021-06-22 10:15ranjith_qualiantech_comStatusnew => scheduled
2021-06-28 07:58hgbotNote Added: 0129827
2021-06-29 07:35hgbotResolutionopen => fixed
2021-06-29 07:35hgbotStatusscheduled => closed
2021-06-29 07:35hgbotNote Added: 0129886
2021-06-29 07:35hgbotFixed in Version => RR21Q3
2021-06-29 07:35hgbotNote Added: 0129887
2021-08-12 09:26sebastien_lironFile Added: 47024.diff
2021-08-12 09:26sebastien_lironFile Deleted: 47024.diff

Notes
(0129827)
hgbot   
2021-06-28 07:58   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/490 [^]
(0129886)
hgbot   
2021-06-29 07:35   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/490 [^]
(0129887)
hgbot   
2021-06-29 07:35   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 58e47439d614440d749176191f887d78bb35768e
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2021-06-29T05:35:02+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/58e47439d614440d749176191f887d78bb35768e [^]

Fixed ISSUE-47024: Session timeout should be cleared if product is scanned through Scanner

---
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
---