Openbravo Issue Tracking System - Retail Modules
View Issue Details
0052728Retail ModulesSessionspublic2023-06-13 11:112023-10-02 08:31
william_vermersch 
ranjith_qualiantech_com 
highmajorrandom
closedfixed 
30Openbravo Appliance 14.04
 
 
No
0052728: Duplicate opened sessions can be created when setting business date
It seems that it is possible to click multiple time on Done button when setting business date (high latency/load on the POS).

Adding some logs to maybe better understand the issue:

03-06-2023 08:50:22 retail.loginbusinessdate Process: setBusinessDate - finished - (575499C5FAA6A319F829B44E85019C41)
03-06-2023 08:50:22 retail.loginbusinessdate Process: setBusinessDate - started - (575499C5FAA6A319F829B44E85019C41)
03-06-2023 08:50:22 retail.loginbusinessdate | multiColumn - leftToolbar Clicked on 'icon' - (btnDone - icon)
03-06-2023 08:50:23 retail.loginbusinessdate [opentill][AvoidCountCashAndSendOpenTill] Send open till without UI; stackTrace: OB.OBPOSSession.CountCash.Model.AvoidCountCashAndSendOpenTill (https://weldom.cloud.openbravo.com/openbravo/web/js/gen/02f977056d0e0b41f05eaac8ac40e678.js:5827:350 [^])
03-06-2023 08:50:23 retail.loginbusinessdate Process: setBusinessDate - finished - (F7F1F043DB81D9A68CF7F7C89B406ED0)
03-06-2023 08:50:23 retail.loginbusinessdate Process: setBusinessDate - started - (F7F1F043DB81D9A68CF7F7C89B406ED0)
03-06-2023 08:50:23 retail.loginbusinessdate | multiColumn - leftToolbar Clicked on 'icon' - (btnDone - icon)
03-06-2023 08:50:25 retail.loginbusinessdate | dynamicConfirmationPopup Process: showLoading - finished - (04EA1F48AA14FEE451EFF7C5DD6477A6)

We can see that it was possible to click on the button 2 times before the popup was displayed.
Since it seems to be related to high latency/load on the POS, the only way to reproduce it (on a local POS, not on a production environment), is to setTimeout the function starting the process.

In approvedRequest method of BusinessDateModel.js :

if (approved) {
        setTimeout(() => {
          var setBusinessDate,
            execution = OB.UTIL.ProcessController.start('setBusinessDate'),
            me = this;
...
}, 200);

-----

Connect to a POS (closed store)
Go to the set business date step
Input the business date
Click multiple time on the Done button (upper toolbar)

-----
You will have multiple sessions opened (check screenshot)
I suppose that in the tap method of the toolbar button, the first step should be to disable it, and enable it in a callback method.
No tags attached.
related to defect 0051207RR20Q3.4 closed ranjith_qualiantech_com Refreshing when setting the business date creates duplicated sessions 
related to defect 0045833 closed ranjith_qualiantech_com It is possible to have two tills opened at the same time 
related to defect 0053362 closed Rajesh_18 POS asked for doing a cash up in every login if the till is Closed in Backend and the cash up stuck in Data Import Entries 
png multiple_session.png (31,475) 2023-06-13 11:11
https://issues.openbravo.com/file_download.php?file_id=18642&type=bug
png
Issue History
2023-06-13 11:11william_vermerschNew Issue
2023-06-13 11:11william_vermerschAssigned To => Retail
2023-06-13 11:11william_vermerschFile Added: multiple_session.png
2023-06-13 11:11william_vermerschTriggers an Emergency Pack => No
2023-06-13 11:19william_vermerschDescription Updatedbug_revision_view_page.php?rev_id=26251#r26251
2023-06-13 18:36ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2023-06-14 10:15ranjith_qualiantech_comStatusnew => scheduled
2023-06-16 07:27hgbotNote Added: 0151249
2023-06-23 08:22hgbotNote Added: 0151537
2023-06-23 08:22hgbotResolutionopen => fixed
2023-06-23 08:22hgbotStatusscheduled => closed
2023-06-23 08:22hgbotNote Added: 0151538
2023-06-26 09:38william_vermerschNote Added: 0151623
2023-06-26 09:38william_vermerschStatusclosed => new
2023-06-26 09:38william_vermerschResolutionfixed => open
2023-06-27 06:41ranjith_qualiantech_comStatusnew => scheduled
2023-06-29 14:50hgbotNote Added: 0151861
2023-06-30 09:28hgbotResolutionopen => fixed
2023-06-30 09:28hgbotStatusscheduled => closed
2023-06-30 09:28hgbotNote Added: 0151928
2023-06-30 09:28hgbotNote Added: 0151929
2023-10-02 08:27malsasuaRelationship addedrelated to 0053362
2023-10-02 08:28malsasuaRelationship addedrelated to 0051207
2023-10-02 08:31malsasuaRelationship addedrelated to 0045833

Notes
(0151249)
hgbot   
2023-06-16 07:27   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/merge_requests/87 [^]
(0151537)
hgbot   
2023-06-23 08:22   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/merge_requests/87 [^]
(0151538)
hgbot   
2023-06-23 08:22   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions [^]
Changeset: 5c05f0f85b1ed262cb559cb4171510083423927a
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 23-06-2023 05:56:48
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/commit/5c05f0f85b1ed262cb559cb4171510083423927a [^]

Fixed ISSUE-52728: BusinessDate Done button should be disabled after clicking it

---
M web/org.openbravo.retail.sessions/js/components/BusinessDateModel.js
M web/org.openbravo.retail.sessions/js/components/BusinessDateWindowView.js
---
(0151623)
william_vermersch   
2023-06-26 09:38   
Hi Ranjith,

Thank you for the fix, unfortunately it is still doable do click before the popin is displayed.

I moved the callback to this location (BusinessDateModel.js) :

if (
          !OB.POS.modelterminal.get('terminal').poss_session &&
          OB.MobileApp.model.get('payments').length &&
          hasCashPaymentWithCountCash
        ) {
          OB.POS.navigate('retail.logincountcash');
          callback(true);
        } else {
          OB.OBPOSSession.CountCash.Model.AvoidCountCashAndSendOpenTill(() =>
            callback(true)
          );
        }

With this it seems to work, can you check if you can validate this, or propose a better option ?

Regards,
William
(0151861)
hgbot   
2023-06-29 14:50   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/merge_requests/90 [^]
(0151928)
hgbot   
2023-06-30 09:28   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions [^]
Changeset: 6fe0d3cb6e79e1fb16aa8eec97c99b84b615305e
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 28-06-2023 16:48:09
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/commit/6fe0d3cb6e79e1fb16aa8eec97c99b84b615305e [^]

Fixed ISSUE-52728: BusinessDate Done button should be disabled until process completed

---
M web/org.openbravo.retail.sessions/js/components/BusinessDateModel.js
---
(0151929)
hgbot   
2023-06-30 09:28   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/merge_requests/90 [^]