Openbravo Issue Tracking System - Retail Modules
View Issue Details
0029290Retail ModulesWeb POSpublic2015-03-16 15:532015-03-30 14:04
malsasua 
Orekaria 
normalminoralways
closedfixed 
20Community Appliance
 
RR15Q2 
marvintm
No
0029290: Stabilization: The 'OB.MobileApp.model.syncAllModels' process should be executed once
If there are several calls in parallel to sync process, only should be executed one time.

SyncAllModels should always execute a callback
1)
. with eclipse in debug mode, add a breakpoint in orderloader process
. in WEB POS, create and pay a new receipt
. the execution will be stopped in the breakpoint
. wait 30 seconds
. remove the breakpoint and press F8 (continue execution)

error will be displayed in the console:
ERROR org.hibernate.util.JDBCExceptionReporter - ORA-00001: unique constraint (RET_TEST_ORACLE.C_ORDER_KEY) violated

2) Verify that the syncAllModels does not always execute a callback

3) Copy and execute these lines in the browser console:

OB.MobileApp.model.syncAllModels(function () {console.log('a')}, function () {console.error('Ea')} )
OB.MobileApp.model.syncAllModels(function () {console.log('b')}, function () {console.error('Eb')} )
OB.MobileApp.model.syncAllModels(function () {console.log('c')}, function () {console.error('Ec')} )
OB.MobileApp.model.syncAllModels(function () {console.log('d')}, function () {console.error('Ed')} )
OB.MobileApp.model.syncAllModels(function () {console.log('e')}, function () {console.error('Ee')} )
OB.MobileApp.model.syncAllModels(function () {console.log('f')}, function () {console.error('Ef')} )


Verify this output n times:
 The model 'cashup' has been fully synchronized with the server; line: OB.Dal.find.proc.exec.removeSyncedElemsCallback (http://localhost:8080/openbravo/web/js/gen/0bceab924d738331f5d7f9f59695a2e0_WebPOS.js:3897:18 [^]) (*,+)
0bceab924d738331f5d7f9f59695a2e0_WebPOS.js:7602 runSyncProcess: synchronization successfully done;
No tags attached.
depends on feature request 0028933RR16Q1 closed Retail QA: RR15Q2: Add tests for Mobile applications 
has duplicate defect 0028539RR15Q2 closed aaroncalero If syncAllModels is called before a previous execution has finished, the same data is sent twice to the server 
blocks defect 0029055RR15Q2 closed marvintm Web POS doesn't handle update of local database tables correctly 
blocks feature request 0029377RR15Q3 closed Orekaria Stabilization: RR15Q2 related 
Issue History
2015-03-16 15:53malsasuaNew Issue
2015-03-16 15:53malsasuaAssigned To => marvintm
2015-03-16 15:53malsasuaTriggers an Emergency Pack => No
2015-03-16 17:49OrekariaRelationship addedblocks 0029055
2015-03-16 17:49OrekariaRelationship addeddepends on 0028933
2015-03-16 17:50OrekariaDescription Updatedbug_revision_view_page.php?rev_id=7987#r7987
2015-03-16 17:50OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7989#r7989
2015-03-16 18:13OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7990#r7990
2015-03-16 18:13OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7991#r7991
2015-03-16 18:18hgbotCheckin
2015-03-16 18:18hgbotNote Added: 0075648
2015-03-17 10:40hgbotCheckin
2015-03-17 10:40hgbotNote Added: 0075683
2015-03-26 14:34OrekariaRelationship addedblocks 0029377
2015-03-26 19:57hgbotCheckin
2015-03-26 19:57hgbotNote Added: 0076037
2015-03-26 19:57hgbotStatusnew => resolved
2015-03-26 19:57hgbotResolutionopen => fixed
2015-03-26 19:57hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/d381597016f2111019a5bbf2f420ac90694e359a [^]
2015-03-26 21:26OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8123#r8123
2015-03-27 08:56aaroncaleroRelationship addedhas duplicate 0028539
2015-03-27 09:29hgbotCheckin
2015-03-27 09:29hgbotNote Added: 0076058
2015-03-27 09:29hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/d381597016f2111019a5bbf2f420ac90694e359a [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6c723d5265ce3315925f60cb887b7dc4837610b5 [^]
2015-03-27 09:31OrekariaSummaryprocess OB.MobileApp.model.syncAllModels should be executed one time => Stabilization: The 'OB.MobileApp.model.syncAllModels' process should be executed once
2015-03-27 17:37marvintmAssigned Tomarvintm => Orekaria
2015-03-30 12:34marvintmReview Assigned To => marvintm
2015-03-30 12:34marvintmStatusresolved => closed
2015-03-30 12:34marvintmFixed in Version => RR15Q2
2015-03-30 14:04hgbotCheckin
2015-03-30 14:04hgbotNote Added: 0076143

Notes
(0075648)
hgbot   
2015-03-16 18:18   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 9e79ba98152b17c998d90f6665be6ab5c01161a0
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Mon Mar 16 18:17:22 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/9e79ba98152b17c998d90f6665be6ab5c01161a0 [^]

Related to issue 29290: Execute a callback in each of the flow paths of the SyncAllModels method

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0075683)
hgbot   
2015-03-17 10:40   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 43f1095c323285ed4a7ef6513a12bfe826f7f9bf
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Tue Mar 17 10:38:56 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/43f1095c323285ed4a7ef6513a12bfe826f7f9bf [^]

Related to issue 29290: Execute the callback if the callback exists

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0076037)
hgbot   
2015-03-26 19:57   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: d381597016f2111019a5bbf2f420ac90694e359a
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Thu Mar 26 18:56:57 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/d381597016f2111019a5bbf2f420ac90694e359a [^]

Fixes issue 29290: 'SyncAllModels' can now handle stacked calls

- when the method is called and another previous call was executed, the model being synchronizing will end its synchronization but the rest of the models will not. and all the models will start the synchronization again
- when the synchronization is finished, all gathered callbacks will be executed in the same order as they were captured
- the functionality has been refactored for better readability
- a new function has been added that allows to execute a queue of callbacks
- several comments have been added

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
M web/org.openbravo.mobile.core/source/utils/ob-utilities.js
---
(0076058)
hgbot   
2015-03-27 09:29   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 6c723d5265ce3315925f60cb887b7dc4837610b5
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Fri Mar 27 09:28:32 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6c723d5265ce3315925f60cb887b7dc4837610b5 [^]

Fixes issue 29290: 'SyncAllModels' can now handle stacked calls (II)

- the syncrhonization process will not be executed again if there is currently one being executed
- a in development check has been added to verify that the queue is empty when the successCallbacks are called

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0076143)
hgbot   
2015-03-30 14:04   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 0935ecae13b3d730d461be48d058f456f8b2db5d
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Mon Mar 30 14:04:17 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/0935ecae13b3d730d461be48d058f456f8b2db5d [^]

Related to issue 29290: Beautifier and explicit variable reset

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---