Openbravo Issue Tracking System - Retail Modules
View Issue Details
0043990Retail ModulesWeb POSpublic2020-05-07 17:482020-05-21 10:22
jarmendariz 
jarmendariz 
normalminoralways
closedfixed 
5
 
RR20Q3RR20Q3 
marvintm
No
0043990: Application State is not cleared up when switching terminal or unlinking a terminal
When application sources changes, all pending messages are sent and all storage (localstorage, indexedDB and state) are cleared up.
This same behavior should be expected when switching to another terminal or, when
terminal authentication is enabled, when terminal is unlinked of a physical device.
- In backoffice, with role "White Valley Group Admin", set Preference "Terminal Log Synchronization Interval in seconds" to a high value, for example: 10000

Now in WebPOS:
- Login in the VBS-1 terminal
- Using the JS Console in the developer tools, write a log line:
  OB.info('a log from VBS-1')
- Check that this log is saved in the application State. Execute the following line:
  OB.App.State.getState().TerminalLog.events.find(ev => ev.m && ev.m.includes('VBS-1'))
- The output of this command should return an object with the log message:
{d: 1588864904515, o: true, t: "l", m: "a log from VBS-1 terminal; stackTrace: <anonymous>:1:4", l: "Info", …}

- Now switch to another terminal, like VBS1001
- Once logged in, run the same command above to find our saved log message
- Check that this command still returns the same TerminalLog entry, meaning that the State wasn't cleared up.
 
No tags attached.
Issue History
2020-05-07 17:48jarmendarizNew Issue
2020-05-07 17:48jarmendarizAssigned To => jarmendariz
2020-05-07 17:48jarmendarizTriggers an Emergency Pack => No
2020-05-07 17:49jarmendarizStatusnew => scheduled
2020-05-12 17:54jarmendarizReview Assigned To => marvintm
2020-05-14 12:05hgbotCheckin
2020-05-14 12:05hgbotNote Added: 0119866
2020-05-14 12:05hgbotStatusscheduled => resolved
2020-05-14 12:05hgbotResolutionopen => fixed
2020-05-14 12:05hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/2f2f963b3ced4ff10f59396819140241e900c113 [^]
2020-05-14 12:06hgbotCheckin
2020-05-14 12:06hgbotNote Added: 0119867
2020-05-21 10:22marvintmStatusresolved => closed
2020-05-21 10:22marvintmFixed in Version => RR20Q3

Notes
(0119866)
hgbot   
2020-05-14 12:05   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 2f2f963b3ced4ff10f59396819140241e900c113
Author: Javier Armendáriz <javier.armendariz <at> openbravo.com>
Date: Tue May 12 10:41:33 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/2f2f963b3ced4ff10f59396819140241e900c113 [^]

Fixed BUG-43990: State is not reset when switching to another terminal

Added an item in localStorage to check that the state should be reloaded by a terminal change
and/or a device unlink. To do this refresh we purge the backup in the IndexedDB database.

---
M web-test/base/fake-redux.js
M web-test/base/ob-app.js
M web-test/model/application-state/StatePersistence.functional.test.js
M web-test/model/application-state/StatePersistence.test.js
M web/org.openbravo.mobile.core/app/model/application-state/StatePersistence.js
M web/org.openbravo.mobile.core/source/utils/ob-localStorage.js
---
(0119867)
hgbot   
2020-05-14 12:06   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 623414952725feb73912bb959b15522ba4f120be
Author: Javier Armendáriz <javier.armendariz <at> openbravo.com>
Date: Tue May 12 10:44:31 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/623414952725feb73912bb959b15522ba4f120be [^]

Related to BUG-43990: Ensure localstorage is clear when terminal is unlinked with device

---
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
---