Openbravo Issue Tracking System - POS2
View Issue Details
0049928POS2Corepublic2022-08-01 14:142022-08-03 14:28
AugustoMauch 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
 
No
0049928: State persistence errors should be more visible
Currently is there is an error when persisting the state, the error is not logged anywhere. Persistence errors are very severe because they can lead to other issues, so whenever an error occurs we should make sure it is included in the terminal log with some information that might help to understand why the persistence failed.
- Install the patch attached. It will add a state action that allows to add additional information to the ticket.
- Open WebPOS, open the developer tools
- In the console, create a big string: bigData = 'x'.repeat(5*1024*1024)
- Assign the big string to the state using the new state action: OB.App.State.Ticket.setTicketExtraInfo({extraInfo: bigData}). There will be an error because the state cannot be persisted but it will not be logged in the terminal log
No tags attached.
diff ticketExtraInfo.diff (1,866) 2022-08-01 14:14
https://issues.openbravo.com/file_download.php?file_id=17360&type=bug
Issue History
2022-08-01 14:14AugustoMauchNew Issue
2022-08-01 14:14AugustoMauchAssigned To => AugustoMauch
2022-08-01 14:14AugustoMauchTriggers an Emergency Pack => No
2022-08-01 14:14AugustoMauchFile Added: ticketExtraInfo.diff
2022-08-01 14:14AugustoMauchProjectRetail Modules => POS2
2022-08-01 14:15AugustoMauchStatusnew => scheduled
2022-08-01 14:17AugustoMauchCategoryWeb POS => Core
2022-08-01 14:17AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=24572#r24572
2022-08-01 14:19hgbotNote Added: 0139769
2022-08-02 00:14hgbotResolutionopen => fixed
2022-08-02 00:14hgbotStatusscheduled => closed
2022-08-02 00:14hgbotFixed in Version => RR22Q4
2022-08-02 00:14hgbotNote Added: 0139779
2022-08-02 00:14hgbotNote Added: 0139780
2022-08-03 14:28hgbotFixed in VersionRR22Q4 => RR22Q3
2022-08-03 14:28hgbotNote Added: 0139842

Notes
(0139769)
hgbot   
2022-08-01 14:19   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/390 [^]
(0139779)
hgbot   
2022-08-02 00:14   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: 8246c59e6f8eebe3eaf124da4a32bfe426686bb2
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 02-08-2022 00:14:01
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/8246c59e6f8eebe3eaf124da4a32bfe426686bb2 [^]

Fixes ISSUE-49928: Persistence errors are now included in the terminal log

Now whenever there is a persistence error it will be logged in the terminal log, including the current size of the state and the current size of the local storage. For instance:

ERROR PERSISTING DATA: QuotaExceededError: Failed to execute setItem on Storage: Setting the value of POS2_state/State/persist:root exceeded the quota.. localStorage use: [{"k":"POS2.services","s":19568},{"k":"POS2.masterDataHashes","s":11587},{"k":"POS2.processes","s":10541},{"k":"POS2_state/State/persist:root","s":9950},{"k":"POS2.backendMasterDataHashes","s":5830},{"k":"POS2.terminalSchedule","s":1646},{"k":"POS2.AppFormat","s":664},{"k":"POS2.HWM.VBS-2.2","s":34},{"k":"POS2.HWM.VBS-2.1","s":34},{"k":"POS2.HWM.VBS-2.0","s":34}]. current state use: [{"k":"Ticket","s":5247092},{"k":"UI","s":19718},{"k":"Configuration","s":4937},{"k":"Cashup","s":1728},{"k":"TerminalLog","s":1393},{"k":"DocumentSequence","s":708},{"k":"RemoteServer","s":460},{"k":"Session","s":144},{"k":"Setting","s":81},{"k":"_persist","s":32}]; stackTrace: http://localhost:8080/openbravo/web/pos/static/js/6.576efc4b.chunk.js:1:101069\; [^]
writeFailHandler (http://localhost:8080/openbravo/web/pos/static/js/6.576efc4b.chunk.js:1:101451 [^]);
_ (http://localhost:8080/openbravo/web/pos/static/js/5.bc43fc85.chunk.js:2:61352 [^])

---
M web/org.openbravo.mobile.core/app/model/application-state/StatePersistence.js
---
(0139780)
hgbot   
2022-08-02 00:14   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/390 [^]
(0139842)
hgbot   
2022-08-03 14:28   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: 025be97b8188436bc554c6fa8a661dcf723227d3
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 03-08-2022 14:28:14
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/025be97b8188436bc554c6fa8a661dcf723227d3 [^]

Fixes ISSUE-49928: Persistence errors are now included in the terminal log

Now whenever there is a persistence error it will be logged in the terminal log, including the current size of the state and the current size of the local storage. For instance:

ERROR PERSISTING DATA: QuotaExceededError: Failed to execute setItem on Storage: Setting the value of POS2_state/State/persist:root exceeded the quota.. localStorage use: [{"k":"POS2.services","s":19568},{"k":"POS2.masterDataHashes","s":11587},{"k":"POS2.processes","s":10541},{"k":"POS2_state/State/persist:root","s":9950},{"k":"POS2.backendMasterDataHashes","s":5830},{"k":"POS2.terminalSchedule","s":1646},{"k":"POS2.AppFormat","s":664},{"k":"POS2.HWM.VBS-2.2","s":34},{"k":"POS2.HWM.VBS-2.1","s":34},{"k":"POS2.HWM.VBS-2.0","s":34}]. current state use: [{"k":"Ticket","s":5247092},{"k":"UI","s":19718},{"k":"Configuration","s":4937},{"k":"Cashup","s":1728},{"k":"TerminalLog","s":1393},{"k":"DocumentSequence","s":708},{"k":"RemoteServer","s":460},{"k":"Session","s":144},{"k":"Setting","s":81},{"k":"_persist","s":32}]; stackTrace: http://localhost:8080/openbravo/web/pos/static/js/6.576efc4b.chunk.js:1:101069\; [^]
writeFailHandler (http://localhost:8080/openbravo/web/pos/static/js/6.576efc4b.chunk.js:1:101451 [^]);
_ (http://localhost:8080/openbravo/web/pos/static/js/5.bc43fc85.chunk.js:2:61352 [^])

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