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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0032415
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajorsometimes2016-03-05 16:292016-03-30 18:20
ReporterOrekariaView Statuspublic 
Assigned Toaaroncalero 
PrioritynormalResolutionfixedFixed in VersionRR16Q2
StatusclosedFix in branchFixed in SCM revision410127cfc57e
ProjectionnoneETAnoneTarget VersionRR16Q2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToOrekaria
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0032415: [Services] Asynchronous processes can corrupt receipt data

DescriptionAsynchronous processes can corrupt receipt data

The problem is that lasting asynchronous processes are still being executed while the application is available for user actions
Steps To ReproduceA.
Apply the attached patch
Create or execute a test with a single line receipt (e.g: CreateSaleWithEAN

Verify that the console shows log similar to (tweak the patch timeouts so 'first' is before 'second'):

6478 [Thread-0] INFO CreateSaleWithEAN - Tap on 'BUTTON_PAY_DONE'
6553 [Thread-0] WARN CreateSaleWithEAN - Allowed (exclusion): http://192.168.1.35:8080/openbravo/web/js/gen/726b345e9ea7139b002dfb0550badbf2_WebPOS.js [^] 30261:17 [dev] first
6553 [Thread-0] INFO CreateSaleWithEAN - Verifying that 'LABEL_TOTALTOPAY' = '0.00'
7594 [Thread-0] WARN CreateSaleWithEAN - TestRegistry has been forced to refresh
7646 [Thread-0] WARN CreateSaleWithEAN - Allowed (exclusion): http://192.168.1.35:8080/openbravo/web/js/gen/726b345e9ea7139b002dfb0550badbf2_WebPOS.js [^] 22329:25 [dev] second
8702 [Thread-0] WARN CreateSaleWithEAN - TestRegistry has been forced to refresh
8768 [Thread-0] INFO CreateSaleWithEAN - After test verifications
8792 [Thread-0] INFO CreateSaleWithEAN - Synchronizing terminal and server
9097 [Thread-0] INFO CreateSaleWithEAN - There are no pending POST or GET requests to the server
9101 [Thread-0] INFO CreateSaleWithEAN - Waiting for the 'c_import_entry' to process all 'Initial' records
10104 [Thread-0] INFO CreateSaleWithEAN - Waiting for the 'c_import_entry' to process all 'Initial' records
12283 [main] INFO CreateSaleWithEAN - Test failed
12606 [main] INFO CreateSaleWithEAN - Screenshot taken: </tmp/tip/last-results/openbravo/screenshots/17:11:28 FAILED: CreateSaleWithEAN.png>
12606 [main] INFO CreateSaleWithEAN -

*** Error: ***

org.junit.internal.runners.model.MultipleFailureException: There were 2 errors:
  java.lang.AssertionError((1) errors in the browser log:
[2016-03-05T17:11:24+0100] [SEVERE] http://192.168.1.35:8080/openbravo/web/js/gen/726b345e9ea7139b002dfb0550badbf2_WebPOS.js [^] 2561:19 The receipt has been modified while it was being closed:
{
  "lines": {
    "0": {
      "hasRelatedServices": [
        null,
        false
      ]
    }
  }
}


B.
See also attached image
Proposed SolutionFollow the asynchronous flows of the The 'addProductToOrder' method in order.js

a- Ensure that since the method is executed until it finishes, the SynchronizationHelper is blocking the pay button

b- Deasynchronize the flow
TagsNo tags attached.
Attached Filespatch file icon reproduceTheIssue.patch [^] (12,511 bytes) 2016-03-05 17:05 [Show Content]
png file icon .png [^] (34,991 bytes) 2016-03-05 17:26


png file icon test failure2.png [^] (35,199 bytes) 2016-03-05 17:35


png file icon test failure3.png [^] (36,389 bytes) 2016-03-05 20:02


diff file icon FixIssue32415.diff [^] (2,623 bytes) 2016-03-07 16:54 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0032070 closedaaroncalero The HasServices process should block the Pay button 

-  Notes
(0084768)
aaroncalero (manager)
2016-03-07 12:09

Attached possible solution. The 'blocking range' of the SynchronizationHelper has been extended while calculating if a product has services or not.
(0084870)
hgbot (developer)
2016-03-10 16:39

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 8fe534dc24be39218ca3f60e599a25554890c1c4
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Wed Mar 09 09:53:33 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/8fe534dc24be39218ca3f60e599a25554890c1c4 [^]

Fixed issue 32415: [Services] Asynchronous processes can corrupt receipt data

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0085343)
Orekaria (administrator)
2016-03-30 16:43

OB.UTIL.SynchronizationHelper.finished(synchId, 'HasServices'); must be closed if the following condition is not fullfilled
  if (me.get('lines').contains(line)) {
(0085344)
hgbot (developer)
2016-03-30 17:31

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 410127cfc57ee72b2e4660d2a5cb1e87d04c3972
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Wed Mar 30 17:30:05 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/410127cfc57ee72b2e4660d2a5cb1e87d04c3972 [^]

Fixed issue 32415: [Services] Asynchronous processes can corrupt receipt data

Added SynchronizationHelper closing for the HasServices process, when the line is removed during the calculateReceipt process (e.g. this can happen if taxes cannot be calculated)

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

- Issue History
Date Modified Username Field Change
2016-03-05 16:29 Orekaria New Issue
2016-03-05 16:29 Orekaria Assigned To => Retail
2016-03-05 16:29 Orekaria Triggers an Emergency Pack => No
2016-03-05 16:29 Orekaria Proposed Solution updated
2016-03-05 16:32 Orekaria Description Updated View Revisions
2016-03-05 16:32 Orekaria Steps to Reproduce Updated View Revisions
2016-03-05 16:32 Orekaria Steps to Reproduce Updated View Revisions
2016-03-05 16:35 Orekaria Summary [Services] The 'addProductToOrder' asynchronous processes can break the receipt coherence => [Services] The 'addProductToOrder' asynchronous processes can corrupt receipt data
2016-03-05 16:35 Orekaria Description Updated View Revisions
2016-03-05 16:48 Orekaria Summary [Services] The 'addProductToOrder' asynchronous processes can corrupt receipt data => [Services] Asynchronous processes can corrupt receipt data
2016-03-05 16:48 Orekaria Description Updated View Revisions
2016-03-05 16:52 Orekaria Steps to Reproduce Updated View Revisions
2016-03-05 17:05 Orekaria File Added: reproduceTheIssue.patch
2016-03-05 17:13 Orekaria Steps to Reproduce Updated View Revisions
2016-03-05 17:26 Orekaria File Added: .png
2016-03-05 17:26 Orekaria Steps to Reproduce Updated View Revisions
2016-03-05 17:35 Orekaria File Added: test failure2.png
2016-03-05 20:02 Orekaria File Added: test failure3.png
2016-03-07 12:09 aaroncalero File Added: FixIssue32415.diff
2016-03-07 12:09 aaroncalero Note Added: 0084768
2016-03-07 12:12 aaroncalero Relationship added related to 0032070
2016-03-07 16:53 aaroncalero File Deleted: FixIssue32415.diff
2016-03-07 16:54 aaroncalero File Added: FixIssue32415.diff
2016-03-10 16:39 hgbot Checkin
2016-03-10 16:39 hgbot Note Added: 0084870
2016-03-10 16:39 hgbot Status new => resolved
2016-03-10 16:39 hgbot Resolution open => fixed
2016-03-10 16:39 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/8fe534dc24be39218ca3f60e599a25554890c1c4 [^]
2016-03-11 09:01 marvintm Assigned To Retail => Orekaria
2016-03-18 08:43 aaroncalero Review Assigned To => Orekaria
2016-03-18 08:43 aaroncalero Assigned To Orekaria => aaroncalero
2016-03-30 16:41 Orekaria Status resolved => new
2016-03-30 16:41 Orekaria Resolution fixed => open
2016-03-30 16:41 Orekaria Status new => scheduled
2016-03-30 16:43 Orekaria Note Added: 0085343
2016-03-30 17:31 hgbot Checkin
2016-03-30 17:31 hgbot Note Added: 0085344
2016-03-30 17:31 hgbot Status scheduled => resolved
2016-03-30 17:31 hgbot Resolution open => fixed
2016-03-30 17:31 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/8fe534dc24be39218ca3f60e599a25554890c1c4 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/410127cfc57ee72b2e4660d2a5cb1e87d04c3972 [^]
2016-03-30 18:20 Orekaria Status resolved => closed
2016-03-30 18:20 Orekaria Fixed in Version => RR16Q2


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker