Openbravo Issue Tracking System - Retail Modules
View Issue Details
0030479Retail ModulesWeb POSpublic2015-07-31 20:532015-09-09 16:07
Orekaria 
Orekaria 
normalmajoralways
closedfixed 
5
 
RR15Q4 
marvintm
No
0030479: Stabilization: Creating a clone of an object should not fire any event
Stabilization: Creating a clone of an object should not fire any event

The clone information could be compromised
a) Verify that 'OB.UTIL.clone' in 'ob-utilities.js' is setting values without the 'silent: true' flag

b) Verify that when an object is cloned, the 'changed' event is fired for each of the set properties

c) Performance: execute with and without 'silent: true', the following script in the console log:

    var startTime = new Date();
    var receipt = new OB.Model.Order();
    for (var i = 0; i < 100; i++) {
      var frozenReceipt = new OB.Model.Order();
      OB.UTIL.clone(receipt, frozenReceipt);
    }
    var endTime = new Date();
    var timeDiff = endTime - startTime;
    console.error(timeDiff);

Verify that the time spent in the cloning is about 10% less when 'silent: true'
No tags attached.
related to defect 0030805 closed Orekaria Clone of the receipt is no longer necessary, so it should be reverted 
blocks defect 0030465RR15Q4 closed Orekaria Stabillization: When the receipt is done, an immutable copy of it should be used in the involved asynchronous processes 
blocks defect 0030598RR15Q4 closed Orekaria Stabilization: 'receipt.clearWith' is used when 'OB.UTIL.clone' should 
blocks defect 0030603RR15Q4 closed Orekaria Stabilization: RR15Q4 related issues 
Issue History
2015-07-31 20:53OrekariaNew Issue
2015-07-31 20:53OrekariaAssigned To => Orekaria
2015-07-31 20:53OrekariaTriggers an Emergency Pack => No
2015-07-31 21:15OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9134#r9134
2015-07-31 23:15hgbotCheckin
2015-07-31 23:15hgbotNote Added: 0079162
2015-07-31 23:15hgbotStatusnew => resolved
2015-07-31 23:15hgbotResolutionopen => fixed
2015-07-31 23:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/2f463b608c3fef7d3835ba0d99c1e008c9b00c22 [^]
2015-08-03 21:21hgbotCheckin
2015-08-03 21:21hgbotNote Added: 0079166
2015-08-03 21:21hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/2f463b608c3fef7d3835ba0d99c1e008c9b00c22 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3bcb9a8e5e7dd2d7c65d94701685fadfe7088aa4 [^]
2015-08-05 09:49OrekariaNote Added: 0079197
2015-08-18 18:47OrekariaStatusresolved => new
2015-08-18 18:47OrekariaResolutionfixed => open
2015-08-18 18:47OrekariaRelationship addedblocks 0030465
2015-08-18 23:12OrekariaRelationship addedblocks 0030598
2015-08-19 10:01OrekariaDescription Updatedbug_revision_view_page.php?rev_id=9234#r9234
2015-08-19 12:33OrekariaRelationship addedblocks 0030603
2015-08-22 10:10OrekariaTarget Version => RR15Q4
2015-08-22 20:33hgbotCheckin
2015-08-22 20:33hgbotNote Added: 0079594
2015-08-22 20:33hgbotCheckin
2015-08-22 20:33hgbotNote Added: 0079595
2015-08-22 20:35hgbotCheckin
2015-08-22 20:35hgbotNote Added: 0079601
2015-08-22 20:35hgbotCheckin
2015-08-22 20:35hgbotNote Added: 0079605
2015-08-22 20:35hgbotStatusnew => resolved
2015-08-22 20:35hgbotResolutionopen => fixed
2015-08-22 20:35hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3bcb9a8e5e7dd2d7c65d94701685fadfe7088aa4 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4bee35aa96e047e8ee5ecadc7ffc489710a5d3e4 [^]
2015-08-22 20:36hgbotCheckin
2015-08-22 20:36hgbotNote Added: 0079624
2015-08-22 20:39hgbotCheckin
2015-08-22 20:39hgbotNote Added: 0079626
2015-09-09 16:07marvintmRelationship addedrelated to 0030805
2015-09-09 16:07marvintmReview Assigned To => marvintm
2015-09-09 16:07marvintmStatusresolved => closed

Notes
(0079162)
hgbot   
2015-07-31 23:15   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 2f463b608c3fef7d3835ba0d99c1e008c9b00c22
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Fri Jul 31 22:13:31 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/2f463b608c3fef7d3835ba0d99c1e008c9b00c22 [^]

Fixes issue 30479: The clone object will only create a copy, it will not fire any event

The problem is that firing events can have unexpected consecuences

This is a risky change. The current integration reports no error. Theoretically this change helps stabilization but there is an scenario in which this change could lead to errors: in case the clone is expected to fire the events. Note that for this special case there is another method call 'clearWith' that should be used.

A constraint has been added while in development to help developers not to fire errors when changing this method

---
M web/org.openbravo.mobile.core/source/utils/ob-utilities.js
---
(0079166)
hgbot   
2015-08-03 21:21   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 3bcb9a8e5e7dd2d7c65d94701685fadfe7088aa4
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Mon Aug 03 21:20:53 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3bcb9a8e5e7dd2d7c65d94701685fadfe7088aa4 [^]

Fixes issue 30479: The clone object will only create a copy, it will not fire any event (II)

The problem with the previous change was that unsubscribing the 'all' event was unsubscribing wanted listeners

- the code has been modified to use a reusable 'all' event
- the 'isBeingCloned' value is now available for any model that has been cloned at least once

---
M web/org.openbravo.mobile.core/source/utils/ob-utilities.js
---
(0079197)
Orekaria   
2015-08-05 09:49   
Cloning is still firing the events of the collections. e.g: the 'add' event
(0079594)
hgbot   
2015-08-22 20:33   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 9a602b16dabd46b7e403a073dbaab6dca1302ab0
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Sat Aug 22 20:32:29 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/9a602b16dabd46b7e403a073dbaab6dca1302ab0 [^]

Related to issue 30450, preamble of issue 30479: jsLint 'ob-utilities'

---
M web/org.openbravo.mobile.core/source/utils/ob-utilities.js
---
(0079595)
hgbot   
2015-08-22 20:33   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: c7fbbb35474894ca7c1045a75fd71b564c578167
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Sat Aug 22 20:32:29 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c7fbbb35474894ca7c1045a75fd71b564c578167 [^]

Related to issue 30479: Improved OB.UTIL.clone logic

- provide a way to externally decide if events will be fired

---
M web/org.openbravo.mobile.core/source/utils/ob-utilities.js
---
(0079601)
hgbot   
2015-08-22 20:35   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 9f29c3232006fb2eb42be52925419e32fad1991b
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Sat Aug 22 20:32:55 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9f29c3232006fb2eb42be52925419e32fad1991b [^]

Related to issue 30479: OB.UTIL.clone does not make use of a third argument

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0079605)
hgbot   
2015-08-22 20:35   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 4bee35aa96e047e8ee5ecadc7ffc489710a5d3e4
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Sat Aug 22 20:32:55 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4bee35aa96e047e8ee5ecadc7ffc489710a5d3e4 [^]

Fixes issue 30479: The 'current' receipt must be an exact clone of the UI receipt

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0079624)
hgbot   
2015-08-22 20:36   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 7a416fea761a03602edf94d368c48fcb73517bfc
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Sat Aug 22 20:32:56 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/7a416fea761a03602edf94d368c48fcb73517bfc [^]

Related to issue 30479: The UI receipt triggers events if it's the target in OB.UTIL.clone

---
M web/org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-model.js
---
(0079626)
hgbot   
2015-08-22 20:39   
Repository: tools/automation/pi-mobile
Changeset: 97ad0882c2a3f3e6e5df66d546d9bf2409726bb9
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Sat Aug 22 20:26:14 2015 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/97ad0882c2a3f3e6e5df66d546d9bf2409726bb9 [^]

Related to issue 30479: Added the 'I30479_VerifyUIReceiptIsMarked' test

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I30479_VerifyUIReceiptIsMarked.java
---