Openbravo Issue Tracking System - Retail Modules
View Issue Details
0050207Retail ModulesWeb POSpublic2022-09-06 09:482022-09-09 13:27
AugustoMauch 
Retail 
normalcriticalhave not tried
closedfixed 
5
 
RR22Q3.1 
No
0050207: State should be compressed before being persisted in the localstorage
The localstorage size limit is quite small (5Mb), so a very big state could not fit in it.

To make this problem less likely to happen, we should compress the state before persisting it. In some tests done using redux-persist-transform-compress, the size of the compressed state was 7x smaller than its uncompressed state.
-
No tags attached.
blocks feature request 0050166 closed Retail State should be compressed before being persisted in the localstorage 
Issue History
2022-09-09 09:55cbernerTypefeature request => backport
2022-09-09 09:55cbernerTarget Version => RR22Q3.1
2022-09-09 10:02hgbotNote Added: 0140897
2022-09-09 10:53hgbotNote Added: 0140903
2022-09-09 13:27hgbotNote Added: 0140935
2022-09-09 13:27hgbotNote Added: 0140936
2022-09-09 13:27hgbotResolutionopen => fixed
2022-09-09 13:27hgbotStatusscheduled => closed
2022-09-09 13:27hgbotNote Added: 0140937
2022-09-09 13:27hgbotFixed in Version => 22Q3.1
2022-09-09 13:27hgbotNote Added: 0140938

Notes
(0140897)
hgbot   
2022-09-09 10:02   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/405 [^]
(0140903)
hgbot   
2022-09-09 10:53   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/835 [^]
(0140935)
hgbot   
2022-09-09 13:27   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: d8a6d5c2df6e26f38161d0af14328f7a7c875e33
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 09-09-2022 10:00:47
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/d8a6d5c2df6e26f38161d0af14328f7a7c875e33 [^]

Related to ISSUE-50207: Supports state compression before persisting it

This changeset enables compressing the state before it is persisted, as long as the ReduxCompressor global object is avaialable. For now
it will be available for core2 applications but not for other mobile applications.

Compression is achieved by passing a compression function as a transformer to the ReduxPersist.persistReducer function.

It is important not to lose the currently persisted state when upgrading from previos persistence approaches. This commit includes an automatic
migration for states persisted uncompressed in localstorage and later on [1] we will add automatic migration for states persisted in IndexedDB.

[1] https://issues.openbravo.com/view.php\?id\=50185 [^]

---
M web/org.openbravo.mobile.core/app/model/application-state/StatePersistence.js
---
(0140936)
hgbot   
2022-09-09 13:27   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/405 [^]
(0140937)
hgbot   
2022-09-09 13:27   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/835 [^]
(0140938)
hgbot   
2022-09-09 13:27   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 301a419f906292a0057d903c90cace5b27fa8347
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 09-09-2022 10:52:58
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/301a419f906292a0057d903c90cace5b27fa8347 [^]

Fixes ISSUE-50207: Enables state persistence compression in core2 applications

To enable the compression of the state when it is persisted, the redux-persist-transform-compress library has been installed
and made available in the ReduxCompressor global variable.

---
M templates/ob-pre.js.template
M web-jspack/org.openbravo.core2/package-lock.json
M web-jspack/org.openbravo.core2/package.json
---