Openbravo Issue Tracking System - POS2
View Issue Details
0050720POS2Corepublic2022-11-03 12:382022-11-08 09:44
cberner 
cberner 
normalmajorhave not tried
closedfixed 
5
 
23Q1 
No
0050720: Terminal log is lost on logout if state is removed before next login
Terminal log is saved when we logout from the application in the state. 0000145:0000030 seconds later, it is moved from state to indexedDB, where it is persisted. If this doesn't happen, because we close the application after logout, anything that is in the state, is susceptible to being removed and not persisted.

We should not lose this terminal log, by forcing save into indexedb just before logout.
1. Login WebPOS and do a cashup.
2. Refresh the application while in login screen, and then clear the current state -> OB.App.State.persistence.stateStorePersistor.purge() in devtools console
3. Try to login, check that terminal log is lost, by going to backend and looking at the terminal log window
No tags attached.
depends on backport 005073022Q4.1 closed cberner Terminal log is lost on logout if state is removed before next login 
depends on backport 005073122Q3.3 closed cberner Terminal log is lost on logout if state is removed before next login 
Issue History
2022-11-03 12:38cbernerNew Issue
2022-11-03 12:38cbernerAssigned To => cberner
2022-11-03 12:38cbernerTriggers an Emergency Pack => No
2022-11-03 12:40hgbotNote Added: 0142875
2022-11-04 10:53guilleaerStatusnew => scheduled
2022-11-07 18:34hgbotNote Added: 0143186
2022-11-07 23:54hgbotResolutionopen => fixed
2022-11-07 23:54hgbotStatusscheduled => closed
2022-11-07 23:54hgbotNote Added: 0143188
2022-11-07 23:54hgbotFixed in Version => 23Q1
2022-11-07 23:54hgbotNote Added: 0143189
2022-11-07 23:54hgbotNote Added: 0143190
2022-11-07 23:54hgbotNote Added: 0143191
2022-11-08 09:44hgbotNote Added: 0143223

Notes
(0142875)
hgbot   
2022-11-03 12:40   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/889 [^]
(0143186)
hgbot   
2022-11-07 18:34   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/431 [^]
(0143188)
hgbot   
2022-11-07 23:54   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/889 [^]
(0143189)
hgbot   
2022-11-07 23:54   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 6d5485e031a5f1b887abb62d565bd98eeb5a5b54
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 07-11-2022 23:54:12
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/6d5485e031a5f1b887abb62d565bd98eeb5a5b54 [^]

Fixes ISSUE-50720: Terminal log is lost on logout if state is removed before next login

To fix this, we force a synchronization of the data just before logout,
this already happens regularly every 30 seconds, so should have little
performance impact.

---
M web-jspack/org.openbravo.core2/src/model/session/Session.js
M web-jspack/org.openbravo.core2/src/model/session/__test__/ClearSession-actionPreparation.test.js
M web-jspack/org.openbravo.core2/src/model/session/__test__/Logout.test.js
M web-jspack/org.openbravo.core2/src/model/session/actions/ClearSessionActionPreparation.js
M web-jspack/org.openbravo.core2/src/model/session/user-actions/Logout.js
---
(0143190)
hgbot   
2022-11-07 23:54   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: cfd2bd05bc61bedf1951f059196fa8ab57a5f4b6
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 07-11-2022 18:33:32
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/cfd2bd05bc61bedf1951f059196fa8ab57a5f4b6 [^]

Related to ISSUE-50720: Extract terminalLogGenerateMessage state action to utility action

The implementation was extracted to a TerminalLog utility action, so it
can be used in pre and posthooks.

---
M web/org.openbravo.mobile.core/app/model/business-object/terminal-log/actions/TerminalLogGenerateMessage.js
---
(0143191)
hgbot   
2022-11-07 23:54   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/431 [^]
(0143223)
hgbot   
2022-11-08 09:44   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 30056be0ae7e18742074a85245582114f8b3b28a
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 08-11-2022 09:43:03
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/30056be0ae7e18742074a85245582114f8b3b28a [^]

Related to ISSUE-50720: Remove code that was commented in Logout.test.js

Also removes part of the code that was added to
ClearSession-actionPreparation.test.js which is no longer necessary for
the test to pass, as the final approach was moving the call from the
actionPreparation to a prehook, which is not tested there.

---
M web-jspack/org.openbravo.core2/src/model/session/__test__/ClearSession-actionPreparation.test.js
M web-jspack/org.openbravo.core2/src/model/session/__test__/Logout.test.js
---