Openbravo Issue Tracking System - POS2
View Issue Details
0052797POS2POSpublic2023-06-20 14:512023-06-21 10:56
AugustoMauch 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
23Q3 
approved
No
No
0052797: Improve log of persistence errors, try to unpause persistence
Sometimes when completing an order or a cashup, we detect that the change has not been properly persisted. This is problematic becuase the next time the state is recovered from the persistence, it will be outdated.

It would be useful to:
- Increase the log when a persistence error is detected by including info about the size of the state and the localstorage, to detect problem caused of the state not fitting in localstorage
- Try to unpause the persistence. A possible reason why the persistence is not working is that it is paused. If we unpause it when we detect a problem, and the problem was caused by a paused persistence, the next time the state is updated it should be properly persisted
We still don't know why the state stops being persisted. To force a persistence error simulating the persistence is paused:
- Open POS2
- Add a product to the ticket
- Open the developer tools and execute: OB.App.State.persistence.stateStorePersistor.pause()
- Go to payments and pay the ticket and complete the ticket
- Notice that an error message will be logged in the console: "[statePersistance] Error when persisting completion of..."
No tags attached.
Issue History
2023-06-20 14:51AugustoMauchNew Issue
2023-06-20 14:51AugustoMauchAssigned To => Retail
2023-06-20 14:51AugustoMauchOBNetwork customer => No
2023-06-20 14:51AugustoMauchTriggers an Emergency Pack => No
2023-06-20 14:51AugustoMauchAssigned ToRetail => AugustoMauch
2023-06-20 14:51AugustoMauchStatusnew => scheduled
2023-06-20 14:55hgbotMerge Request Status => open
2023-06-20 14:55hgbotNote Added: 0151387
2023-06-20 15:23AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=26294#r26294
2023-06-21 10:56hgbotMerge Request Statusopen => approved
2023-06-21 10:56hgbotResolutionopen => fixed
2023-06-21 10:56hgbotStatusscheduled => closed
2023-06-21 10:56hgbotNote Added: 0151430
2023-06-21 10:56hgbotFixed in Version => 23Q3
2023-06-21 10:56hgbotNote Added: 0151431

Notes
(0151387)
hgbot   
2023-06-20 14:55   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1909 [^]
(0151430)
hgbot   
2023-06-21 10:56   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1909 [^]
(0151431)
hgbot   
2023-06-21 10:56   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 64b6dfdb2b9cacecd68bb1a60d92141aa4b091d0
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 21-06-2023 10:55:10
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/64b6dfdb2b9cacecd68bb1a60d92141aa4b091d0 [^]

Fixes ISSUE-52797: Persistence error log should be improved

Now when a persistence error is detected when completing a cashup or a ticket, we:
- log the size of the biggest models in the state and in local storage
- call OB.App.State.persistence.stateStorePersistor.persist() to fix the problem in case the persitence was paused

There is some code duplication in TicketUtils.js and CashupUtils.js but at this point it is not important because
it is debug code meant to be removed when the root cause of the persistence problem is detected and fixed

---
M web-jspack/org.openbravo.pos2/src/model/ticket/TicketUtils.js
M web-jspack/org.openbravo.pos2/src/model/user-interface/user-actions/cashup/CashupUtils.js
---