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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0027162
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POScriticalhave not tried2014-07-23 09:582014-08-01 16:45
ReportermarvintmView Statuspublic 
Assigned Tomarvintm 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisioncd5c9600321b
ProjectionnoneETAnoneTarget Version
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

0027162: Due to wrong uuid generation, it could happen that tickets are lost

DescriptionThe Web POS uses the following mechanism to generate and synchronize data (such as tickets):

- A unique identifier (UUID) is generated for every document created in the client side.
- When the document is complete, it is sent to the backend with this identifier included.
- The backend verifies that a document with this id doesn't exist. If it exists, it considers the document as a duplicate.
- If it doesn't, it saves the document.
- When the backend replies to the client side that the synchronization went well, then the client side removes the document from its internal database.

This system is designed to avoid the problem of duplicated documents, by identifying each one with a unique id. This problem might happen if the client loses connection after sending a document. As it has lost connection, it cannot receive the response from the backend, and therefore it cannot be sure that it was saved correctly, so in this case it sends it again. However, as it has a unique id, the backend will find it and therefore will not duplicate it.

The issue here is that in some cases, it has been detected that the function which generates unique ids in the client side can in fact generate the same id more than once, due to how it is constructed.

This can cause that tickets are lost, due to being incorrectly identified as duplicated.
Steps To ReproduceThere are no clear steps to reproduce. This has been reproduced in a real customer however.
Proposed SolutionThe get_uuid function needs to be rebuilt so that it works correctly.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 0026977RR14Q4 closedmarvintm Retail Stabilization: Failure Proof Ticket Saving, save to websql before printing 

-  Notes
(0068860)
hgbot (developer)
2014-07-24 12:40

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: f440ab4b2250d1e90a2bdad3976b38953aaf4567
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Jul 24 12:39:21 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/f440ab4b2250d1e90a2bdad3976b38953aaf4567 [^]

Fixed issue 27162. Two changes have been made:
- A new uuid generation method has been included. This new method will work much better, and should not produce duplicated ids.
- An additional check has been added, in case the id of the new ticket corresponds to the id of an existing ticket. In this case, the document numbers will be compared to verify that the tickets are indeed the same, and otherwise, the new ticket will be saved as an error instead of being discarded.

---
M src/org/openbravo/mobile/core/process/DataSynchronizationProcess.java
M web/org.openbravo.mobile.core/source/data/ob-dal.js
---
(0068861)
hgbot (developer)
2014-07-24 12:41

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: cd5c9600321bf250f4061acce65747536deec358
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Jul 24 12:40:29 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/cd5c9600321bf250f4061acce65747536deec358 [^]

Fixed issue 27162. Two changes have been made:
- A new uuid generation method has been included. This new method will work much better, and should not produce duplicated ids.
- An additional check has been added, in case the id of the new ticket corresponds to the id of an existing ticket. In this case, the document numbers will be compared to verify that the tickets are indeed the same, and otherwise, the new ticket will be saved as an error instead of being discarded.

---
M src/org/openbravo/retail/posterminal/OrderLoader.java
---
(0068862)
hgbot (developer)
2014-07-24 12:48

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 891cc7b85af7e733e33b84eb993b491f48b959bd
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Jul 24 12:47:47 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/891cc7b85af7e733e33b84eb993b491f48b959bd [^]

Related to issue 27162. Fixed jslint warnings

---
M web/org.openbravo.mobile.core/source/data/ob-dal.js
---
(0068867)
Orekaria (administrator)
2014-07-24 13:55

Revised and Tested with DuplicatedTicketAreSavedProperly and EquivalentTicketsSavedCorrectly
(0068872)
Orekaria (administrator)
2014-07-24 17:25

Test created: I27162_GetuuidFailsToBeUnique
Although this test generates only 100.000 random ids, it will be able to probe the uniqueness in a long period of time.
If this test fails more than once in a very long time... the algorithm is failing to be unique and should be revisited
(0069036)
hgbot (developer)
2014-08-01 16:45

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 04dab10f54aeaa38134523d6ea634edb585a8551
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Fri Aug 01 16:45:07 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/04dab10f54aeaa38134523d6ea634edb585a8551 [^]

Related to issue 27162. Small changes after code-review

---
M src/org/openbravo/retail/posterminal/OrderLoader.java
---

- Issue History
Date Modified Username Field Change
2014-07-23 09:58 marvintm New Issue
2014-07-23 09:58 marvintm Assigned To => marvintm
2014-07-23 09:58 marvintm Triggers an Emergency Pack => No
2014-07-23 10:57 mtaal Issue Monitored: mtaal
2014-07-23 11:08 adrianromero Relationship added related to 0026977
2014-07-24 12:40 hgbot Checkin
2014-07-24 12:40 hgbot Note Added: 0068860
2014-07-24 12:40 hgbot Status new => resolved
2014-07-24 12:40 hgbot Resolution open => fixed
2014-07-24 12:40 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/f440ab4b2250d1e90a2bdad3976b38953aaf4567 [^]
2014-07-24 12:41 hgbot Checkin
2014-07-24 12:41 hgbot Note Added: 0068861
2014-07-24 12:41 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/f440ab4b2250d1e90a2bdad3976b38953aaf4567 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/cd5c9600321bf250f4061acce65747536deec358 [^]
2014-07-24 12:48 hgbot Checkin
2014-07-24 12:48 hgbot Note Added: 0068862
2014-07-24 13:55 Orekaria Review Assigned To => Orekaria
2014-07-24 13:55 Orekaria Note Added: 0068867
2014-07-24 13:55 Orekaria Status resolved => closed
2014-07-24 17:25 Orekaria Note Added: 0068872
2014-08-01 16:45 hgbot Checkin
2014-08-01 16:45 hgbot Note Added: 0069036


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker