Openbravo Issue Tracking System - Retail Modules
View Issue Details
0053414Retail ModulesWeb POSpublic2023-09-07 13:362023-09-14 11:15
AugustoMauch 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
RR23Q4 
No
0053414: If a master data refresh fails, the next time the user logs in, the refresh should be repeated
The following case is theoretically possible:
- When the user logs in, conditions are met so that the full/incremental master data refresh takes place
- Something goes wrong during that master data refresh, the process ends in error when only some of the models have been updated, user is logged out
- Next time the user logs in, conditions to do a full/incremental master data refresh are not met, so user logs in in the application having potentially inconsistent data due to the failed refresh.

We can be sure that of the reasons that trigger a refresh will still be met the next time the user logs in if the previous refreshed failed, i.e. the master data refresh timeout. But we cannot be sure about others (i.e. there are several ways to do forced updates).

The current implementations already tries to force the masterdata to be refreshed in case the latest one failed [1], but that mechanism will not be triggered

To prevent this problem, we have to ensure that regardless of other conditions are met, if a previous master data refreshed failed, the next time the user logs in the master data refresh is restarted if the browser failed or if the tab was closed before reaching that line.

[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/blob/master/web/org.openbravo.mobile.core/app/model/masterdata/MasterdataController.js#L140 [^]
- To be done
No tags attached.
Issue History
2023-09-07 13:36AugustoMauchNew Issue
2023-09-07 13:36AugustoMauchAssigned To => AugustoMauch
2023-09-07 13:36AugustoMauchTriggers an Emergency Pack => No
2023-09-07 13:36AugustoMauchStatusnew => scheduled
2023-09-11 09:05AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=26797#r26797
2023-09-11 17:38hgbotNote Added: 0154687
2023-09-11 17:39hgbotNote Added: 0154688
2023-09-14 09:16hgbotNote Added: 0154829
2023-09-14 09:16hgbotNote Added: 0154830
2023-09-14 11:15hgbotResolutionopen => fixed
2023-09-14 11:15hgbotStatusscheduled => closed
2023-09-14 11:15hgbotNote Added: 0154838
2023-09-14 11:15hgbotFixed in Version => RR23Q4
2023-09-14 11:15hgbotNote Added: 0154839

Notes
(0154687)
hgbot   
2023-09-11 17:38   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/612 [^]
(0154688)
hgbot   
2023-09-11 17:39   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1245 [^]
(0154829)
hgbot   
2023-09-14 09:16   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 328abceb740a20718a2df3050e4f4a27b75a31fb
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 14-09-2023 07:16:28
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/328abceb740a20718a2df3050e4f4a27b75a31fb [^]

Related to ISSUE-53414: Adds missing log with reason that triggered master data refresh

---
M web-jspack/org.openbravo.core2/src/model/user-interface/user-actions/RefreshMasterdata.js
---
(0154830)
hgbot   
2023-09-14 09:16   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1245 [^]
(0154838)
hgbot   
2023-09-14 11:15   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/612 [^]
(0154839)
hgbot   
2023-09-14 11:15   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: 9cd130a864e561132b095e5794a949c71025b194
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 14-09-2023 08:01:36
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/9cd130a864e561132b095e5794a949c71025b194 [^]

Fixes ISSUE-53414: Masterdata refresh must be restarted if previous attempt did not finish with success

A new check has been added to ensure that regardless of the reason why a master data refresh was triggered, if it fails, the
next time the user logs in a new master data refresh of the same kind (full / incremental) will be triggered.

There was already a mechanism in place to try to address this case, but it was only being triggered when the master data refresh
finishes having failed for some models. If the process does not finish (i.e. the browser crashes in the process, or the user closes
the tab), then potentially the next the user logs in, he could be permitted to log in with inconsistent data

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