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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0032443
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[Retail Modules] Web POSminorhave not tried2016-03-09 11:362016-06-20 16:55
ReportermtaalView Statuspublic 
Assigned ToSandrahuguet 
PrioritynormalResolutionfixedFixed in VersionRR16Q3
StatusclosedFix in branchFixed in SCM revisionc396d14324f8
ProjectionnoneETAnoneTarget VersionRR16Q3
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomtaal
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0032443: Prevent changing out-dated/stale data (ticket/BP) in webpos

DescriptionWith the current webpos version it is possible to load a ticket (layaway) in multiple terminals and change it in both, one change overwriting the other, or change it in the backoffice while it is already loaded in a webpos were it then get changed afterwards.

So it is possible that a ticket change is overwritten by ticket loaded earlier in webpos.

The same issue can arise with BP data.
Steps To Reproducerun OB Commerce
start 2 browsers
load the same layaway in 2 browsers
change the layaway in both and submit one after the other
only one of the changes is saved
Proposed SolutionWhen sending a ticket/data to the server check if there has not already been a change in the data. If so then reject the transaction, throw an error with a nice user message.

To implement this:
- when loading data from the server include the updated timestamp
- then when changing this data and sending it back to the server send the original updated timestamp with it and check on the server if it hasn't changed since then
- if it has changed don't perform the transaction, instead throw an exception

Do this for tickets, BPs and BP addresses.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0034001 closedSandrahuguet verify the updated date is not necessary in "prevent changing out-dated/stale data (ticket/BP)" feature 
causes defect 0033511 closedranjith_qualiantech_com Error When completing layaway from backend with payment method discount 
causes defect 0034285 closedranjith_qualiantech_com Customer can not be edited 
causes defect 0034466 closedranjith_qualiantech_com Layaway payments not created with time offset 

-  Notes
(0085381)
mtaal (manager)
2016-04-01 11:13

Note: also handle the case that the json contains an updated record, while the record has not yet been created in the database. So the stale data timestamp should be used to detect both the case that the record was updated by the json while it doesn't yet exist or that the record in the database is stale.

So these cases:
1) Detect insert has not happened (can only really happen in case of multi-server):
- webpos A creates a BP on store server
- webpos A updates BP on store server, update message is also send to central
- central server receives the update BP message but notices that the BP does not yet exist, it can throw an exception or only a warning and try again in the next cycle

2) Later update happened hasn't been synced yet
- webpos A loads BP at 11:01 am and updates on store server
- webpos A loads BP again and 11:03 am and updates on store server
- last update is also send to central server, there it is detected that the first update hasn't happened yet, the choice is to wait or to throw an exception

3) Stale date
- webpos A loads BP at 11:01 am
- webpos B loads BP at 11:02 am
- webpos B updates BP at 11:03 am
- webpos A updates BP at 11:04 am --> should give error as the BP has been updated in the mean time
(0086454)
hgbot (developer)
2016-05-16 08:54

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 65a71ebd583ae7511c94526bc7fcdfe0c892c7f8
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Tue May 10 17:39:03 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/65a71ebd583ae7511c94526bc7fcdfe0c892c7f8 [^]

Fixed issue 32443 Prevent changing out-dated data in webpos

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/retail/posterminal/CustomerAddrLoader.java
M src/org/openbravo/retail/posterminal/CustomerLoader.java
M src/org/openbravo/retail/posterminal/OrderLoader.java
M src/org/openbravo/retail/posterminal/master/BPLocationProperties.java
M src/org/openbravo/retail/posterminal/master/BusinessPartnerProperties.java
M web/org.openbravo.retail.posterminal/js/data/datacustomeraddrsave.js
M web/org.openbravo.retail.posterminal/js/data/datacustomersave.js
M web/org.openbravo.retail.posterminal/js/model/bplocation.js
M web/org.openbravo.retail.posterminal/js/model/businesspartner.js
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/customeraddrdetailview.js
---
(0086455)
hgbot (developer)
2016-05-16 08:57

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: c396d14324f8ca0baa52b18ba15c0033a6ef1f09
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Mon May 16 08:57:24 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c396d14324f8ca0baa52b18ba15c0033a6ef1f09 [^]

Fixed issue 32443 Prevent changing out-dated data in webpos

---
M src/org/openbravo/mobile/core/process/DataSynchronizationProcess.java
A src/org/openbravo/mobile/core/process/OutDatedDataChangeException.java
---
(0086456)
hgbot (developer)
2016-05-16 09:12

Repository: tools/automation/pi-mobile
Changeset: 14515ed225995c6321a8a7765867b2ff985828ef
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Tue May 10 17:43:19 2016 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/14515ed225995c6321a8a7765867b2ff985828ef [^]

related to issue 32443 Prevent changing out-dated data in webpos

---
M src-test/org/openbravo/test/mobile/common/selenium/utils/OBDate.java
M src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/orderloader/RetailOrderLoaderTest.java
M src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/orderloader/message-order-paypartial1-1.json
M src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/orderloader/message-order-paypartial2-1.json
M src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/orderloader/message-order-ship-1.json
---
(0086459)
hgbot (developer)
2016-05-16 11:55

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 5f40cfe8c9e648bc79105d450ff72d9706368ac7
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Mon May 16 11:54:38 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/5f40cfe8c9e648bc79105d450ff72d9706368ac7 [^]

related to issue 32443 fixed javadoc

---
M src/org/openbravo/mobile/core/process/OutDatedDataChangeException.java
---
(0086875)
dmitry_mezentsev (developer)
2016-06-01 10:27

Not closed for 16 days!
(0087040)
mtaal (manager)
2016-06-06 17:15

Hi,
It worked but the logging of the customer/customer addr stale update didn't happen. The result of the call to messageBD has to be given to log.warn method.
In both CustomerLoader and CustomerAddrLoader.

Also, can you add a testcase which does the following:
- set the synchronized mode preference
- open a layaway
- change the layaway in the database directly
- add a payment to the layaway
- press done
--> a error message should pop up
- at the end of the test the synchronized pref needs to be removed
(0087187)
hgbot (developer)
2016-06-13 08:54

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 15381b93c214a4d672d97e4ce37d954d458d20f6
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Thu Jun 09 17:46:43 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/15381b93c214a4d672d97e4ce37d954d458d20f6 [^]

related to issue 32443 result of the call to messageBD has to be given to log.warn

---
M src/org/openbravo/retail/posterminal/CustomerAddrLoader.java
M src/org/openbravo/retail/posterminal/CustomerLoader.java
---
(0087219)
hgbot (developer)
2016-06-14 08:25

Repository: tools/automation/pi-mobile
Changeset: ba885cc69793eae32e4c45f923b5e251ae7c9d3a
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Tue Jun 14 08:17:18 2016 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/ba885cc69793eae32e4c45f923b5e251ae7c9d3a [^]

related to issue 32443 added I32443_LayawayStaleData test

---
M src-test/org/openbravo/test/mobile/common/selenium/utils/AllowedErrorsHelper.java
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/layaway/I32443_LayawayStaleData.java
---
(0087237)
hgbot (developer)
2016-06-14 10:42

Repository: tools/automation/pi-mobile
Changeset: d6b192a7064b87664c436d6cbac2d36cfd9aa72e
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Tue Jun 14 10:41:59 2016 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/d6b192a7064b87664c436d6cbac2d36cfd9aa72e [^]

related to issue 32443 delete unnecessary code

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/layaway/I32443_LayawayStaleData.java
---
(0087683)
mtaal (manager)
2016-06-20 16:55

Reviewed and tested

- Issue History
Date Modified Username Field Change
2016-03-09 11:36 mtaal New Issue
2016-03-09 11:36 mtaal Assigned To => mtaal
2016-03-09 11:36 mtaal Triggers an Emergency Pack => No
2016-03-09 11:36 mtaal Summary Prevent changing out-dated/stale ticket in webpos => Prevent changing out-dated/stale data (ticket/BP) in webpos
2016-03-09 11:36 mtaal Description Updated View Revisions
2016-04-01 11:13 mtaal Note Added: 0085381
2016-04-01 11:13 mtaal Assigned To mtaal => Sandrahuguet
2016-04-19 09:02 Sandrahuguet Status new => scheduled
2016-05-16 08:54 hgbot Checkin
2016-05-16 08:54 hgbot Note Added: 0086454
2016-05-16 08:54 hgbot Status scheduled => resolved
2016-05-16 08:54 hgbot Resolution open => fixed
2016-05-16 08:54 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/65a71ebd583ae7511c94526bc7fcdfe0c892c7f8 [^]
2016-05-16 08:57 hgbot Checkin
2016-05-16 08:57 hgbot Note Added: 0086455
2016-05-16 08:57 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/65a71ebd583ae7511c94526bc7fcdfe0c892c7f8 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c396d14324f8ca0baa52b18ba15c0033a6ef1f09 [^]
2016-05-16 08:58 Sandrahuguet Review Assigned To => mtaal
2016-05-16 09:12 hgbot Checkin
2016-05-16 09:12 hgbot Note Added: 0086456
2016-05-16 11:55 hgbot Checkin
2016-05-16 11:55 hgbot Note Added: 0086459
2016-06-01 10:27 dmitry_mezentsev Note Added: 0086875
2016-06-06 17:15 mtaal Note Added: 0087040
2016-06-06 17:15 mtaal Status resolved => new
2016-06-06 17:15 mtaal Resolution fixed => open
2016-06-13 08:54 hgbot Checkin
2016-06-13 08:54 hgbot Note Added: 0087187
2016-06-14 08:25 hgbot Checkin
2016-06-14 08:25 hgbot Note Added: 0087219
2016-06-14 08:29 Sandrahuguet Status new => scheduled
2016-06-14 08:29 Sandrahuguet Status scheduled => resolved
2016-06-14 08:29 Sandrahuguet Resolution open => fixed
2016-06-14 10:42 hgbot Checkin
2016-06-14 10:42 hgbot Note Added: 0087237
2016-06-20 16:55 mtaal Note Added: 0087683
2016-06-20 16:55 mtaal Status resolved => closed
2016-06-20 16:55 mtaal Fixed in Version => RR16Q3
2016-07-20 15:58 ranjith_qualiantech_com Relationship added causes 0033511
2016-09-15 12:28 Sandrahuguet Relationship added related to 0034001
2016-11-03 19:34 dmitry_mezentsev Relationship added causes 0034285
2017-01-12 10:54 ranjith_qualiantech_com Relationship added causes 0034466


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker