Openbravo Issue Tracking System - Retail Modules
View Issue Details
0044352Retail ModulesWeb POSpublic2020-06-12 09:492020-06-22 10:57
jarmendariz 
jarmendariz 
urgentminorhave not tried
closedfixed 
5
 
RR20Q3RR20Q3 
marvintm
No
0044352: State.getState() should not deep-clone the state
With the new application state, to avoid mutating the state directly, OB.App.State.getState() makes a deep clone of the state persisted in Redux. This is inconvenient for two reasons:
1- This allows developers to mutate the cloned state, which is a bad practice and a bad example that can be followed on actions/action preparations where state must me immutable
2- Deep cloning the whole state may lead to performance issues

For this reason, it is preferable not to clone the state in this function.
See above
Remove deep clone in getState function and return the state as-is.
No tags attached.
Issue History
2020-06-12 09:49jarmendarizNew Issue
2020-06-12 09:49jarmendarizAssigned To => jarmendariz
2020-06-12 09:49jarmendarizTriggers an Emergency Pack => No
2020-06-12 09:58jarmendarizStatusnew => scheduled
2020-06-12 11:44jarmendarizReview Assigned To => marvintm
2020-06-16 12:24hgbotCheckin
2020-06-16 12:24hgbotNote Added: 0120861
2020-06-16 12:24hgbotStatusscheduled => resolved
2020-06-16 12:24hgbotResolutionopen => fixed
2020-06-16 12:24hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/406cf2e1275915a4a1b3a738e6cafaa1367e67df [^]
2020-06-17 09:01hgbotCheckin
2020-06-17 09:01hgbotNote Added: 0120880
2020-06-22 10:57marvintmStatusresolved => closed
2020-06-22 10:57marvintmFixed in Version => RR20Q3

Notes
(0120861)
hgbot   
2020-06-16 12:24   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 406cf2e1275915a4a1b3a738e6cafaa1367e67df
Author: Javier Armendáriz <javier.armendariz <at> openbravo.com>
Date: Fri Jun 12 09:57:17 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/406cf2e1275915a4a1b3a738e6cafaa1367e67df [^]

Fixed ISSUE-44352: getState function should not deep clone state

---
M web-test/model/application-state/State.test.js
M web/org.openbravo.mobile.core/app/model/application-state/State.js
---
(0120880)
hgbot   
2020-06-17 09:01   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 3529d663b1c950ee8c2d650e0b48ee9b63363a62
Author: Javier Armendáriz <javier.armendariz <at> openbravo.com>
Date: Wed Jun 17 09:00:53 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3529d663b1c950ee8c2d650e0b48ee9b63363a62 [^]

Related to ISSUE-44352: Fixed ESLint issue

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