Openbravo Issue Tracking System - Retail Modules
View Issue Details
0050166Retail ModulesWeb POSpublic2022-09-06 09:482022-09-09 11:00
AugustoMauch 
Retail 
normalcriticalhave not tried
closedfixed 
5
 
 
No
0050166: 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.
related to defect 0050185 new Triage Platform Base State is lost when upgrading from indexeddb persistence to localstorage persistence 
depends on backport 0050207RR22Q3.1 closed Retail State should be compressed before being persisted in the localstorage 
depends on backport 0050208RR22Q2.3 closed Retail State should be compressed before being persisted in the localstorage 
Issue History
2022-09-06 09:48AugustoMauchNew Issue
2022-09-06 09:48AugustoMauchAssigned To => Retail
2022-09-06 09:48AugustoMauchTriggers an Emergency Pack => No
2022-09-06 09:49AugustoMauchStatusnew => scheduled
2022-09-07 10:40AugustoMauchRelationship addedrelated to 0050185
2022-09-07 17:14hgbotNote Added: 0140822
2022-09-07 17:27hgbotNote Added: 0140823
2022-09-09 09:55cbernerStatusscheduled => acknowledged
2022-09-09 09:55cbernerStatusacknowledged => scheduled
2022-09-09 11:00hgbotResolutionopen => fixed
2022-09-09 11:00hgbotStatusscheduled => closed
2022-09-09 11:00hgbotNote Added: 0140904
2022-09-09 11:00hgbotFixed in Version => 22Q4
2022-09-09 11:00hgbotNote Added: 0140905
2022-09-09 11:00hgbotNote Added: 0140906
2022-09-09 11:00hgbotNote Added: 0140907

Notes
(0140822)
hgbot   
2022-09-07 17:14   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/404 [^]
(0140823)
hgbot   
2022-09-07 17:27   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/833 [^]
(0140904)
hgbot   
2022-09-09 11:00   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/833 [^]
(0140905)
hgbot   
2022-09-09 11:00   
Directly closing issue as related merge request is already approved.

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

Fixes ISSUE-50166: 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
---
(0140906)
hgbot   
2022-09-09 11:00   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/404 [^]
(0140907)
hgbot   
2022-09-09 11:00   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: 7003b00bdbdfbb10e6cc864fa25ca02f2997b140
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 09-09-2022 08:59:59
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/7003b00bdbdfbb10e6cc864fa25ca02f2997b140 [^]

Related to ISSUE-50166: 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
---