Openbravo Issue Tracking System - POS2
View Issue Details
0052675POS2Corepublic2023-06-06 09:062023-06-16 00:17
meriem_azaf 
meriem_azaf 
normalmajorhave not tried
closedfixed 
5
 
22Q4 
No
0052675: Reduce the number of times the state is persisted on disk
The state is being persisted way too often, and that might be a cause of some of the performance problems that have an impact on the 'back to the past” state problem.

As part of this issue we will try to reduce the number of times the state is persisted by:

Adding a new property to persisted models if true will trigger a throttled persistence just after the state action takes place

Increasing the length of redux’s default throttle from 100m to a much longer value (i.e. 30s)

This will prevent the state from being persisted on disk every time the user executes any action (log would be generated and TerminalLog is a persisted model state).
-
No tags attached.
blocks defect 0052052 closed AugustoMauch Reduce the number of times the state is persisted on disk 
Issue History
2023-06-06 09:06meriem_azafNew Issue
2023-06-06 09:06meriem_azafAssigned To => Triage Platform Base
2023-06-06 09:06meriem_azafTriggers an Emergency Pack => No
2023-06-06 09:07meriem_azafRelationship addedblocks 0052052
2023-06-06 09:07meriem_azafAssigned ToTriage Platform Base => meriem_azaf
2023-06-06 09:07meriem_azafStatusnew => scheduled
2023-06-06 10:06hgbotNote Added: 0150779
2023-06-06 11:06hgbotNote Added: 0150787
2023-06-15 23:44hgbotResolutionopen => fixed
2023-06-15 23:44hgbotStatusscheduled => closed
2023-06-15 23:44hgbotNote Added: 0151229
2023-06-15 23:44hgbotFixed in Version => RR22Q4.3
2023-06-15 23:44hgbotNote Added: 0151230
2023-06-15 23:44hgbotNote Added: 0151231
2023-06-15 23:44hgbotNote Added: 0151232
2023-06-16 00:17hgbotFixed in VersionRR22Q4.3 => RR22Q3.3
2023-06-16 00:17hgbotNote Added: 0151238
2023-06-16 00:17hgbotNote Added: 0151239

Notes
(0150779)
hgbot   
2023-06-06 10:06   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/544 [^]
(0150787)
hgbot   
2023-06-06 11:06   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1128 [^]
(0151229)
hgbot   
2023-06-15 23:44   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/544 [^]
(0151230)
hgbot   
2023-06-15 23:44   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: 02eb8391a6099d7650d2a627abc694ae14276d31
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 15-06-2023 23:29:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/02eb8391a6099d7650d2a627abc694ae14276d31 [^]

Fixes ISSUE-52675: Reduce the number of times the state will be persisted

This fix means to reduce the number of times the application state is persisted (in localStorage, as of now).
Previous behaviour:
* state actions that generate entries in the Messages model are persisted immediately
* other state actions that belong to persisted models are persisted withing a 100ms throttle
* a persistence is forced when logging out

New behaviour:
* state actions that generate entries in the Messages model are persisted immediately (same as before)
* other state actions that belong to persisted models: a) If they its triggerPersistence is set, they are persisted within a 200ms throttle a) If they its triggerPersistence is not set, they are persisted within a 60s throttle (or persisted when any other persistence with higher priority is triggered)
* a persistence is forced when logging out (same as before)
* a persistence is forced when the window is about to be closed/refreshed when the user is logged in

---
M src/org/openbravo/mobile/core/login/MobileCoreLoginUtilsServlet.java
M web-test/model/application-state/State.test.js
M web/org.openbravo.mobile.core/app/model/application-state/State.js
M web/org.openbravo.mobile.core/app/model/application-state/StateAPI.js
M web/org.openbravo.mobile.core/app/model/application-state/StatePersistence.js
M web/org.openbravo.mobile.core/app/model/business-object/remote-server/RemoteServer.js
M web/org.openbravo.mobile.core/app/model/business-object/terminal-log/TerminalLog.js
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0151231)
hgbot   
2023-06-15 23:44   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 98aeaf978c9961b75bd7cb2ef642908e82f05279
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 15-06-2023 23:28:37
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/98aeaf978c9961b75bd7cb2ef642908e82f05279 [^]

Related to ISSUE-52675: Force the state to be flushed on browser close/refresh if user is logged in

---
M web-jspack/org.openbravo.core2/src/authentication/loginInitActions.js
M web-jspack/org.openbravo.core2/src/model/session/__test__/Logout.test.js
M web-jspack/org.openbravo.core2/src/model/session/user-actions/Logout.js
---
(0151232)
hgbot   
2023-06-15 23:44   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1128 [^]
(0151238)
hgbot   
2023-06-16 00:17   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: af40d6f6c5f0f50c28ec01c093ce239c99854777
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 15-06-2023 23:53:33
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/af40d6f6c5f0f50c28ec01c093ce239c99854777 [^]

Fixes ISSUE-52675: Reduce the number of times the state will be persisted

This fix means to reduce the number of times the application state is persisted (in localStorage, as of now).
Previous behaviour:
* state actions that generate entries in the Messages model are persisted immediately
* other state actions that belong to persisted models are persisted withing a 100ms throttle
* a persistence is forced when logging out

New behaviour:
* state actions that generate entries in the Messages model are persisted immediately (same as before)
* other state actions that belong to persisted models: a) If they its triggerPersistence is set, they are persisted within a 200ms throttle a) If they its triggerPersistence is not set, they are persisted within a 60s throttle (or persisted when any other persistence with higher priority is triggered)
* a persistence is forced when logging out (same as before)
* a persistence is forced when the window is about to be closed/refreshed when the user is logged in

---
M src/org/openbravo/mobile/core/login/MobileCoreLoginUtilsServlet.java
M web-test/model/application-state/State.test.js
M web/org.openbravo.mobile.core/app/model/application-state/State.js
M web/org.openbravo.mobile.core/app/model/application-state/StateAPI.js
M web/org.openbravo.mobile.core/app/model/application-state/StatePersistence.js
M web/org.openbravo.mobile.core/app/model/business-object/remote-server/RemoteServer.js
M web/org.openbravo.mobile.core/app/model/business-object/terminal-log/TerminalLog.js
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0151239)
hgbot   
2023-06-16 00:17   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: ba0da76c59a88120134d92b19927e47e66682dd1
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 15-06-2023 23:47:18
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/ba0da76c59a88120134d92b19927e47e66682dd1 [^]

Related to ISSUE-52675: Force the state to be flushed on browser close/refresh if user is logged in

---
M web-jspack/org.openbravo.core2/src/authentication/loginInitActions.js
M web-jspack/org.openbravo.core2/src/model/session/__test__/Logout.test.js
M web-jspack/org.openbravo.core2/src/model/session/user-actions/Logout.js
---