Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036790Retail ModulesWeb POSpublic2017-09-05 13:192017-10-01 23:16
marvintm 
migueldejuana 
urgentmajoralways
closedfixed 
5
 
 
mtaal
No
0036790: Synchronized mode has problems when the request to the backend reaches timeout
There is a problem when using Synchronized mode, if the request to the backend reaches timeout.

The Web POS is blocked until that point, but after the timeout is reached, and a retry is performed, this retry returns with the information that the backend continues executing the process.

Once this happens, a popup is shown to the user informing of this fact. This is correct. However, the user can then close the popup, and start using the Web POS again, and this is incorrect, because as the process is still running, the terminal should continue to be blocked until it finishes.

This can lead to very painful errors, such as tickets being created after one is still being processed, and in this case, the Cashup information would become corrupted because the information loaded for this second ticket would lack the changes of the ticket which is still being processed.
- Activate Synchronize mode
- Make sure you have more than one retry by default configured
- Put a breakpoint in the Orderloader class so that it never finishes
- Log in the Web POS. Create a ticket and complete it.
- Verify that the "Processing transaction" popup is shown
- After timeout is reached, a new request (retry) is performed
- After this request returns, another popup is shown explaining to the user that the request is still being processed.
- The user can close this popup, and continue working. This is wrong, because the order has not yet been synchronized, and the system should continue to be blocked.
- Moreover, if the user now tries to do another ticket, the cashup information will be come incorrect, as it will no longer contain the previous sale.
If Synchronized mode is enabled, in this case the Web POS should continue to be blocked, until it can confirm that the order either was processed successfully in the backend, or failed with an error.
No tags attached.
related to defect 0036918 closed migueldejuana In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario 
related to defect 0036925 new migueldejuana In Synchronized Mode, doing F5 while and order is being loaded if the server goes down we get inconsistency 
has duplicate defect 0036323 closed mtaal When the server is processing a message still then do not execute success or failure on the client 
causes defect 0037210 closed migueldejuana All requests in Synchronize Mode do retry. Just transactional requests should do it. 
Issue History
2017-09-05 13:19marvintmNew Issue
2017-09-05 13:19marvintmAssigned To => Retail
2017-09-05 13:19marvintmTriggers an Emergency Pack => No
2017-09-15 10:14hgbotCheckin
2017-09-15 10:14hgbotNote Added: 0099059
2017-09-15 10:14hgbotStatusnew => resolved
2017-09-15 10:14hgbotResolutionopen => fixed
2017-09-15 10:14hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/45e0fff1629b9c6641757adfebd0ed81f552b9c3 [^]
2017-09-15 11:56marvintmAssigned ToRetail => migueldejuana
2017-09-20 12:55marvintmNote Added: 0099171
2017-09-20 12:55marvintmStatusresolved => new
2017-09-20 12:55marvintmResolutionfixed => open
2017-09-21 15:27migueldejuanaRelationship addedrelated to 0036918
2017-09-22 10:07migueldejuanaRelationship addedrelated to 0036925
2017-09-22 10:10hgbotCheckin
2017-09-22 10:10hgbotNote Added: 0099462
2017-09-22 10:10hgbotStatusnew => resolved
2017-09-22 10:10hgbotResolutionopen => fixed
2017-09-22 10:10hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/45e0fff1629b9c6641757adfebd0ed81f552b9c3 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/ff6702c39ef0dc4cff3dde8d4518e38a691f5fc6 [^]
2017-09-22 14:28marvintmResolution time => 1506636000
2017-09-27 09:10mtaalReview Assigned To => mtaal
2017-10-01 23:16mtaalNote Added: 0099689
2017-10-01 23:16mtaalStatusresolved => closed
2017-10-02 10:20mtaalRelationship addedhas duplicate 0036323
2017-11-02 15:12migueldejuanaRelationship addedcauses 0037210

Notes
(0099059)
hgbot   
2017-09-15 10:14   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 45e0fff1629b9c6641757adfebd0ed81f552b9c3
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Sep 14 09:13:23 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/45e0fff1629b9c6641757adfebd0ed81f552b9c3 [^]

Fixed issue 0036790: Synchronized mode has problems when the request to the backend reaches timeout

- If the message send is processing, keep retrying till it is finished
- Update the text of Synchronized message modal with number o fretries information

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M web/org.openbravo.mobile.core/source/data/ob-requestrouter.js
M web/org.openbravo.mobile.core/source/utils/ob-utilitiesui.js
---
(0099171)
marvintm   
2017-09-20 12:55   
The current solution works fine, except in the case the system was configured to have 0 retries. In that case, when the timeout is reached, the popup disappears, and this is not correct, as the receipt is still being processed.
(0099462)
hgbot   
2017-09-22 10:10   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: ff6702c39ef0dc4cff3dde8d4518e38a691f5fc6
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Sep 21 16:29:55 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/ff6702c39ef0dc4cff3dde8d4518e38a691f5fc6 [^]

Fixed issue 0036790: Synchronized mode has problems when the request to the backend reaches timeout

- Change args setting because it come come from server with different structure
- If the request fail in the last server being in synchronize mode without retries set, keep asking the server also

---
M web/org.openbravo.mobile.core/source/data/ob-requestrouter.js
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0099689)
mtaal   
2017-10-01 23:16   
reviewed and tested