Openbravo Issue Tracking System - Retail Modules
View Issue Details
0045900Retail ModulesWeb POSpublic2021-02-16 09:592021-02-24 11:14
gorka_gil 
gorka_gil 
urgentmajoralways
closedfixed 
5
 
RR21Q2 
https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/commit/87c3e6d251f0c8db080607ba3c4739a551bde0b9 [^]
No
0045900: The background Incremental refresh is silently launching a normal incremental background
There are 3 types of masterdata refresh:
- full
- incremental
- incremental in background (splitted in requests and in save into db)

There are some problems with the incremental in background:
- 1) Before start the requests, a normal incremental is launched,
It is not visible because it doesn't show anything in the UI, but it can be seen in the console.
- 2) In the background incremental, the models requested are not saved into indexeddb
- 3) In the background incremental, the last refresh time is not correctly saved, so it requests always the same data (from last full or normal incremental)
- 4) In the background incremental, the requested model changes are stored in a variable called modifiedMasterdataModels, but it is storing all the model, not just the modified ones.

Note that issues 2, 3 and 4 are hidden by the first one, since the normal incremental does all the update, then when the background starts, there is nothing to update.
In the pos, open the console and execute:
OB.UTIL.loadModelsIncFunc()

It should start with (background incremental):
[requestIncrementalMasterdata] Starting incremental Request RefreshMasterdata

But instead, before that, it is doing a normal incremental:
[incrementalMasterdataRefresh] Starting incremental RefreshMasterdata
NOR
depends on backport 0045923RR21Q1 closed gorka_gil The background Incremental refresh is silently launching a normal incremental background 
depends on backport 0045924RR20Q4.2 closed gorka_gil The background Incremental refresh is silently launching a normal incremental background 
depends on backport 0045925RR20Q3.4 closed gorka_gil The background Incremental refresh is silently launching a normal incremental background 
Issue History
2021-02-16 09:59gorka_gilNew Issue
2021-02-16 09:59gorka_gilAssigned To => gorka_gil
2021-02-16 09:59gorka_gilTriggers an Emergency Pack => No
2021-02-16 10:02hgbotNote Added: 0126120
2021-02-16 11:06gorka_gilRegression introduced by commit => https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/commit/87c3e6d251f0c8db080607ba3c4739a551bde0b9 [^]
2021-02-16 11:10gorka_gilDescription Updatedbug_revision_view_page.php?rev_id=22123#r22123
2021-02-16 11:10gorka_gilSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=22125#r22125
2021-02-19 10:50marvintmStatusnew => scheduled
2021-02-19 11:30rafarodaTag Attached: NOR
2021-02-19 14:29hgbotNote Added: 0126220
2021-02-24 11:14hgbotNote Added: 0126324
2021-02-24 11:14hgbotNote Added: 0126325
2021-02-24 11:14hgbotResolutionopen => fixed
2021-02-24 11:14hgbotStatusscheduled => closed
2021-02-24 11:14hgbotNote Added: 0126326
2021-02-24 11:14hgbotFixed in Version => RR21Q2
2021-02-24 11:14hgbotNote Added: 0126327

Notes
(0126120)
hgbot   
2021-02-16 10:02   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/160 [^]
(0126220)
hgbot   
2021-02-19 14:29   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/310 [^]
(0126324)
hgbot   
2021-02-24 11:14   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 842bdd3936fb947eec0e55128071c721485eb512
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2021-02-24T10:13:23+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/842bdd3936fb947eec0e55128071c721485eb512 [^]

Related to issue-45900: if the login was offline, avoid masterdata refresh on interval

Also fix OB.UTIL.masterdataRefreshStatus when there is no masterdata to update

---
M web/org.openbravo.retail.posterminal/js/utils/ob-utilitiesuipos.js
---
(0126325)
hgbot   
2021-02-24 11:14   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/310 [^]
(0126326)
hgbot   
2021-02-24 11:14   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/160 [^]
(0126327)
hgbot   
2021-02-24 11:14   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: c592304fcfc7fcee0f75946bd642243641777188
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2021-02-22T20:27:11+01:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/c592304fcfc7fcee0f75946bd642243641777188 [^]

Fixes ISSUE-45900: Fix incremental refresh after indexeddb changes

1) Fixed the normal incremental done before the background requests
Move the indexeddb normal incremental and full, from the load models, to the login
after each of the websql full or incremental refresh is done.

This is consistent with the backgroud incremental, that also call to the
update of websql models, and when finish to the update of indexeddb models

2) Fix save into indexeddb of the background incremental
- Check for masterdataModel.data.length instead masterdataModel.length

3) Fix background incremental on indexeddb, to only load the new data
- Fixed removing the save in local store of requestTimestamp,
in a moment that we have the old request date, later is done another save
with the correct date

4) Fix background incremental on indexeddb, to only save in
 modifiedMasterdataModels only the modified models, instead all models.

5) when executig loadModels after an offline login, call to the parent callback
instead the callback, to avoid printng output of masterdata refresh done, when in
reallity it was canceled.

6) Skip load of masterdata on login, this was done in websql inside the loadModels,
but since indexeddb models are not loadded by loadModels, is needed to check
for offlineLogin also outside of loadModels

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