Openbravo Issue Tracking System - Retail Modules
View Issue Details
0049631Retail ModulesWeb POSpublic2022-06-22 18:022023-09-26 15:04
AugustoMauch 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
RR22Q3 
No
0049631: Persist state in LocalStorage instead of in IndexedDB
Persisting the state in IndexedDB has two main disadvantages:
- Reading/writing the state will have an impact on other business logic queries because no two IndexedDB operations can be done at the same time
- We suspect that the many amount of state read/write operations in IndexedDB is resulting in performance degradation in other databases (i.e. masterdata)

We will test how the state is persisted in LocalStorage. This option also has disadvantages, i.e. the state needs to be serialized before being stored.

Also we are throttling the state persistence every 10 ms. We should increase that value at least to 100 ms to prevent persisting the state too often.
-
No tags attached.
diff 49631_mobCore_21Q4.diff (955) 2023-09-26 15:04
https://issues.openbravo.com/file_download.php?file_id=18995&type=bug
Issue History
2022-06-22 18:02AugustoMauchNew Issue
2022-06-22 18:02AugustoMauchAssigned To => AugustoMauch
2022-06-22 18:02AugustoMauchTriggers an Emergency Pack => No
2022-06-22 18:04hgbotNote Added: 0138644
2022-06-24 09:57AugustoMauchStatusnew => scheduled
2022-06-24 09:58AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=24348#r24348
2022-06-24 11:28hgbotResolutionopen => fixed
2022-06-24 11:28hgbotStatusscheduled => closed
2022-06-24 11:28hgbotNote Added: 0138731
2022-06-24 11:28hgbotFixed in Version => RR22Q3
2022-06-24 11:28hgbotNote Added: 0138732
2023-09-26 15:04malsasuaFile Added: 49631_mobCore_21Q4.diff

Notes
(0138644)
hgbot   
2022-06-22 18:04   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/383 [^]
(0138731)
hgbot   
2022-06-24 11:28   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/383 [^]
(0138732)
hgbot   
2022-06-24 11:28   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: e88622362a6bf4b22f51ba13cec233d8ddb59e95
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 24-06-2022 11:21:10
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/e88622362a6bf4b22f51ba13cec233d8ddb59e95 [^]

Fixes ISSUE-49631: Persists the state in LocalStorage instead of in IndexedDB

We are switching the state persistence to LocalStorage because we have noticed that storing it in IndexedDB results
in performance degradation of all IndexedDB queries. For instance, in one terminal, a simple query to a master data
model was taking ~50 ms to be completed, and when we deleted the state database the query duration when down to 2 ms.

We are also increasing the throttling time of the state persistence from 10ms to 100ms. That property determines how
often the state persistence will be done and 10ms was just too often. The only risk of increasing this property is that
it is more likely to miss the persistence of a state change. Now if the browser is refreshed <100 ms after the latest
state change, the change might not be persisted. Even though that window of opportunity is higher, 100ms is still a duration
we are confortable with.

---
M web/org.openbravo.mobile.core/app/model/application-state/StatePersistence.js
---