Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036332Retail ModulesStoreServerpublic2017-06-26 12:142017-07-11 17:32
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
RR17Q4 
marvintm
No
0036332: Incremental load does not call ready with loading in case of remote models in specific case
The normal logic of incremental load calls triggerRead [1] after each locally stored model is reloaded.
However in case of remote model [2] or other cases [3] triggerReady is not called.

The consequence of this is that if the last model in the queue is a remote model the loading popup remains visible and does not go away. See attached screenshot.

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/fbd548334939/web/org.openbravo.mobile.core/source/data/ob-dal.js#l1606 [^]

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/fbd548334939/web/org.openbravo.mobile.core/source/data/ob-dal.js#l1619 [^]

[3]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/fbd548334939/web/org.openbravo.mobile.core/source/data/ob-dal.js#l1624 [^]
Set remote product model
Install gift card module
Put a breakpoint here [1] in the javascript code
Find the GiftCard model in the list of models
OB.OBPOSPointOfSale.Model.PointOfSale.prototype.models
Move the GiftCard model to the end of java script list

Call triggerReady here [1] and remove it here [2]

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/fbd548334939/web/org.openbravo.mobile.core/source/data/ob-dal.js#l1564 [^]

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/fbd548334939/web/org.openbravo.mobile.core/source/data/ob-dal.js#l1606 [^]

No tags attached.
depends on backport 0036369RR17Q2.2 closed mtaal Incremental load does not call ready with loading in case of remote models in specific case 
depends on backport 0036467RR17Q3 closed mtaal Incremental load does not call ready with loading in case of remote models in specific case 
has duplicate defect 0036030 closed mtaal [RR17Q2][Store Server][HighVol] After being POS idle some time, it logs out and gets stuck "Loading..." 
png Idle1.png (244,323) 2017-06-26 12:14
https://issues.openbravo.com/file_download.php?file_id=10868&type=bug
png

diff 36332.diff (600) 2017-06-26 12:15
https://issues.openbravo.com/file_download.php?file_id=10869&type=bug
Issue History
2017-06-26 12:14mtaalNew Issue
2017-06-26 12:14mtaalAssigned To => mtaal
2017-06-26 12:14mtaalFile Added: Idle1.png
2017-06-26 12:14mtaalTriggers an Emergency Pack => No
2017-06-26 12:14mtaalRelationship addedhas duplicate 0036030
2017-06-26 12:15mtaalFile Added: 36332.diff
2017-06-28 22:45mtaalStatusnew => scheduled
2017-06-28 22:48hgbotCheckin
2017-06-28 22:48hgbotNote Added: 0097746
2017-06-28 22:48hgbotStatusscheduled => resolved
2017-06-28 22:48hgbotResolutionopen => fixed
2017-06-28 22:48hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c1f54f03208f0df306a67f2aa155746460d24314 [^]
2017-06-29 10:59mtaalReview Assigned To => marvintm
2017-06-29 13:15mtaalNote Added: 0097765
2017-06-29 13:15mtaalStatusresolved => new
2017-06-29 13:15mtaalResolutionfixed => open
2017-06-29 13:17hgbotCheckin
2017-06-29 13:17hgbotNote Added: 0097766
2017-06-30 10:42mtaalTarget VersionRR17Q3 =>
2017-07-04 09:12mtaalNote Added: 0097818
2017-07-04 09:14hgbotCheckin
2017-07-04 09:14hgbotNote Added: 0097819
2017-07-04 09:14hgbotStatusnew => resolved
2017-07-04 09:14hgbotResolutionopen => fixed
2017-07-04 09:14hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c1f54f03208f0df306a67f2aa155746460d24314 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/46a1e1d2d9498bc4ea719de1d1d6cf3f89704f80 [^]
2017-07-04 09:26hgbotCheckin
2017-07-04 09:26hgbotNote Added: 0097821
2017-07-04 18:56marvintmStatusresolved => closed
2017-07-04 18:56marvintmFixed in Version => RR17Q4
2017-07-11 17:31mtaalNote Added: 0098020
2017-07-11 17:31mtaalStatusclosed => new
2017-07-11 17:31mtaalResolutionfixed => open
2017-07-11 17:31mtaalFixed in VersionRR17Q4 =>
2017-07-11 17:31mtaalStatusnew => scheduled
2017-07-11 17:32mtaalStatusscheduled => resolved
2017-07-11 17:32mtaalFixed in Version => RR17Q4
2017-07-11 17:32mtaalResolutionopen => fixed
2017-07-11 17:32mtaalNote Added: 0098021
2017-07-11 17:32mtaalStatusresolved => closed

Notes
(0097746)
hgbot   
2017-06-28 22:48   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: c1f54f03208f0df306a67f2aa155746460d24314
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Jun 28 22:45:57 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c1f54f03208f0df306a67f2aa155746460d24314 [^]

Fixes issue 36332: Incremental load does not call ready with loading in case of remote models in specific case
Call ready after setting a model load to true

---
M web/org.openbravo.mobile.core/source/data/ob-dal.js
---
(0097765)
mtaal   
2017-06-29 13:15   
backout to research more why the issue happens, it seems difficult to reproduce.
(0097766)
hgbot   
2017-06-29 13:17   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 569413d72c951a856a3e9fa4fd75565e7d016205
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Jun 29 13:16:58 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/569413d72c951a856a3e9fa4fd75565e7d016205 [^]

Related to issue 36332: Incremental load does not call ready with loading in case of remote models in specific case
It is not clearly reproducable, to be sure on the fix, retry in q4

---
M web/org.openbravo.mobile.core/source/data/ob-dal.js
---
(0097818)
mtaal   
2017-07-04 09:12   
The current code has an async issue. This if statement [1] checks the value of the somethigToLoad variable. However, this variable is set to true in an async manner, so this means that the if statement is executed at the wrong time. The variable seems to be set synchronously [3] but the processModelAtIndex is called asynchronously from here [2]. So there is an asynchronous flow possible and this also happens (can be seen when debugging).

The mantis issue is only visible when doing incremental load after login. During login the issue does not occur. Probably becauuse during login the models._LoadOnline [4] is true.


[1]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/d0dc67e84549/web/org.openbravo.mobile.core/source/data/ob-dal.js#l1639 [^]

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/d0dc67e84549/web/org.openbravo.mobile.core/source/data/ob-dal.js#l1574 [^]

[3]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/d0dc67e84549/web/org.openbravo.mobile.core/source/data/ob-dal.js#l1587 [^]

[4]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/d0dc67e84549/web/org.openbravo.mobile.core/source/data/ob-dal.js#l1509 [^]
(0097819)
hgbot   
2017-07-04 09:14   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 46a1e1d2d9498bc4ea719de1d1d6cf3f89704f80
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Jul 04 09:14:33 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/46a1e1d2d9498bc4ea719de1d1d6cf3f89704f80 [^]

Fixes issue 36332: Incremental load does not call ready with loading in case of remote models in specific case
The model ready trigger is executed when the last processModelAtIndex call is done. The flow in the code
will always end up in this point, so no need to have a separate if for this.

---
M web/org.openbravo.mobile.core/source/data/ob-dal.js
---
(0097821)
hgbot   
2017-07-04 09:26   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: f7912942aaa331397eb2674d4f606826619b33a8
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Jul 04 09:26:13 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/f7912942aaa331397eb2674d4f606826619b33a8 [^]

Related to issue 36332: Incremental load does not call ready with loading in case of remote models in specific case
Remove unused var

---
M web/org.openbravo.mobile.core/source/data/ob-dal.js
---
(0098020)
mtaal   
2017-07-11 17:31   
Moving back to new-->scheduled to also backport to q3
(0098021)
mtaal   
2017-07-11 17:32   
closing again after creating backport issue