Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036918
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajoralways2017-09-21 15:272017-10-02 19:52
ReportermigueldejuanaView Statuspublic 
Assigned Tomigueldejuana 
PrioritynormalResolutionfixedFixed in VersionRR17Q4
StatusclosedFix in branchFixed in SCM revisionbf75c8c9a3e0
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomarvintm
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario

DescriptionIn Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario.

If we refresh while an order is being processed in a Synchronized Mode we need to do 3 things depending the status of the order:

- If the order is Processed: We need continue, remove the sent order from the UI and update the cashup info.

- If the order is being Processed: We need to wait till it is synchronized, check it continuously.

- If the order gave an Error: Show a modal showing an error and leave the order in the UI to be able to resend it
Steps To Reproduce- Enable Synchronized Mode
- Put a breakpoint in OrderLoader.java
- Do a sale --> Transaction being processed modal is showm
- Refresh the window
- Resume the breakpoint
- ERROR! We have the sent order in the UI but we already processed it. We are able to resend it and we shouldn't
TagsNo tags attached.
Attached Filespng file icon Selection_043.png [^] (150,870 bytes) 2017-10-01 23:11


diff file icon additional_change_checkprocessing.diff [^] (598 bytes) 2017-10-01 23:11 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0036790 closedmigueldejuana Synchronized mode has problems when the request to the backend reaches timeout 
related to defect 0036987 closedmigueldejuana There are still problems in Synchronized mode when the user refreshes the page (F5) 

-  Notes
(0099217)
hgbot (developer)
2017-09-21 15:50

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 5c4dc52552ccd74f75542c1c9a9d4f1add8693aa
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Sep 21 15:13:10 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/5c4dc52552ccd74f75542c1c9a9d4f1add8693aa [^]

Fixed issue 0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario

- Send inSender parameter in serviceError to know more info from the error. "timeout" or "0" as server is down.
- Add a condition to the SynchronizingDialog to ensure that we control when is show and when is hidden (as we do with showLoading)
- Save the messageId while the transaction is processing, remove it when it is processed

---
M web/org.openbravo.mobile.core/source/data/ob-datasource.js
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0099218)
hgbot (developer)
2017-09-21 15:50

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 2c66d533e1ac98d3d01131482eecbc9ba6602f68
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Sep 21 15:21:58 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2c66d533e1ac98d3d01131482eecbc9ba6602f68 [^]

Fixed issue 0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario

- Add a check CheckProcessingMessage to know the status of the processing message after doing a refresh
- Add CheckProcessingMessage to the services list
- Handle the possible cases:

    * If the order is Processed: We need continue, remove the sent order from the UI and update the cashup info.
    * If the order is being Processed: We need to wait till it is synchronized, check it continuously.
    * If the order gave an Error: Show a modal showing an error and leave the order in the UI to be able to resend it

---
M src-db/database/sourcedata/OBMOBC_SERVICES.xml
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
A src/org/openbravo/retail/posterminal/CheckProcessingMessage.java
---
(0099543)
hgbot (developer)
2017-09-25 13:29

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 50ac454e92e09206b1d18a00b54f42b2c4d34f4a
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Sep 25 13:11:16 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/50ac454e92e09206b1d18a00b54f42b2c4d34f4a [^]

Fixed issue 0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario

- Improve the query performance. Filter by import entry archive id because it is the same of messageId
- Add an else option when checking the processing message to ensure that we do not get blocked.

---
M src/org/openbravo/retail/posterminal/CheckProcessingMessage.java
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
---
(0099572)
hgbot (developer)
2017-09-26 09:49

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 41fc2124602f5ced42746f722de2f5451086a952
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Sep 25 17:17:38 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/41fc2124602f5ced42746f722de2f5451086a952 [^]

Fixed issue 0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario

- Do no execute doPostSynchronizedCallActions because it can be executed before the process in the backend has finished

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0099573)
hgbot (developer)
2017-09-26 09:50

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: f4608148c9c69a8b22d526f3988d1d6ae59cc499
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Sep 25 17:33:07 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/f4608148c9c69a8b22d526f3988d1d6ae59cc499 [^]

Fixed issue 0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario

- Add a function lo load an order by id from orderlist
- Send to frontend the json to ensure that we delete the processed order

---
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0099688)
mtaal (manager)
2017-10-01 23:11

I get a js error when an order has already been processed. See attached screenshot. The data.json field is undefined. When I check the java code of CheckProcessingMessage I don't see any place where it is set. I tried a change to set the json (see attached diff). This works. Can you review and push it?
(0099695)
hgbot (developer)
2017-10-02 14:45

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: bf75c8c9a3e062bbe49926eea786e26f61445b5c
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Oct 02 12:18:14 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/bf75c8c9a3e062bbe49926eea786e26f61445b5c [^]

Fixed issue 0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario

- Add the missing attribute json

---
M src/org/openbravo/retail/posterminal/CheckProcessingMessage.java
---
(0099704)
marvintm (manager)
2017-10-02 19:52

There are still two cases which are not working completely for me right now:
- If I do F5 while in the middle of the processing of the order, I get the popup again (correct), but if then the OrderLoader finishes, on the next retry I get a javascript error in the console, and the receipt is not removed from the UI (wrong):

985f177adb2d112341363d73f496088d.js:3076 TypeError: Cannot read property 'get' of undefined
    at 985f177adb2d112341363d73f496088d.js:37250
    at processResult (985f177adb2d112341363d73f496088d.js:4412); line: Object.OB.UTIL.showError (http://localhost:8080/openbravo/web/js/gen/985f177adb2d112341363d73f496088d.js:11975:6 [^]) (*,+)


(Related to the OB.UTIL.calculateCurrentCash function, and particularly this line:

OB.Dal.findInTransaction(tx, OB.Model.PaymentMethodCashUp, {
        'cashup_id': cashUp.at(0).get('id')

- If I do F5 while in the middle of the processing of the order, but then I process the order while the Web POS is still loading, then the popup is shown (wrong), and it never goes away until I refresh the page again.


However, we are closing this issue and keeping track of these problems in separate issue.

- Issue History
Date Modified Username Field Change
2017-09-21 15:27 migueldejuana New Issue
2017-09-21 15:27 migueldejuana Assigned To => migueldejuana
2017-09-21 15:27 migueldejuana Triggers an Emergency Pack => No
2017-09-21 15:27 migueldejuana Relationship added related to 0036790
2017-09-21 15:40 migueldejuana Description Updated View Revisions
2017-09-21 15:50 hgbot Checkin
2017-09-21 15:50 hgbot Note Added: 0099217
2017-09-21 15:50 hgbot Status new => resolved
2017-09-21 15:50 hgbot Resolution open => fixed
2017-09-21 15:50 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/5c4dc52552ccd74f75542c1c9a9d4f1add8693aa [^]
2017-09-21 15:50 hgbot Checkin
2017-09-21 15:50 hgbot Note Added: 0099218
2017-09-21 15:50 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/5c4dc52552ccd74f75542c1c9a9d4f1add8693aa [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2c66d533e1ac98d3d01131482eecbc9ba6602f68 [^]
2017-09-22 14:28 marvintm Resolution time => 1506636000
2017-09-25 13:29 hgbot Checkin
2017-09-25 13:29 hgbot Note Added: 0099543
2017-09-25 13:29 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2c66d533e1ac98d3d01131482eecbc9ba6602f68 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/50ac454e92e09206b1d18a00b54f42b2c4d34f4a [^]
2017-09-26 09:49 hgbot Checkin
2017-09-26 09:49 hgbot Note Added: 0099572
2017-09-26 09:49 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/50ac454e92e09206b1d18a00b54f42b2c4d34f4a [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/41fc2124602f5ced42746f722de2f5451086a952 [^]
2017-09-26 09:50 hgbot Checkin
2017-09-26 09:50 hgbot Note Added: 0099573
2017-09-26 09:50 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/41fc2124602f5ced42746f722de2f5451086a952 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/f4608148c9c69a8b22d526f3988d1d6ae59cc499 [^]
2017-09-27 09:11 mtaal Review Assigned To => mtaal
2017-10-01 23:11 mtaal Note Added: 0099688
2017-10-01 23:11 mtaal Status resolved => new
2017-10-01 23:11 mtaal Resolution fixed => open
2017-10-01 23:11 mtaal File Added: Selection_043.png
2017-10-01 23:11 mtaal File Added: additional_change_checkprocessing.diff
2017-10-02 14:45 hgbot Checkin
2017-10-02 14:45 hgbot Note Added: 0099695
2017-10-02 14:45 hgbot Status new => resolved
2017-10-02 14:45 hgbot Resolution open => fixed
2017-10-02 14:45 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/f4608148c9c69a8b22d526f3988d1d6ae59cc499 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/bf75c8c9a3e062bbe49926eea786e26f61445b5c [^]
2017-10-02 19:52 marvintm Review Assigned To mtaal => marvintm
2017-10-02 19:52 marvintm Note Added: 0099704
2017-10-02 19:52 marvintm Status resolved => closed
2017-10-02 19:52 marvintm Fixed in Version => RR17Q4
2017-10-02 19:56 marvintm Relationship added related to 0036987


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker