Openbravo Issue Tracking System - POS2
View Issue Details
0050554POS2Corepublic2022-10-17 11:302022-11-07 13:55
AugustoMauch 
cberner 
normalcriticalsometimes
closedfixed 
5
 
22Q3.222Q3.2 
No
0050554: Unexpected management of error leads to state inconsistency
We have noticed that if there is an error during the execution of a state action, sometimes that error is not properly managed.

For instance, both the DeleteTicket and the CompleteTicket action execute the newTicket function to create a new ticket after deleting/completing the current one. Note that both action will send a synchronization message to the backend to create an order (with qty 0 if the order was deleted).

If we force an error on the newTicket function (i.e. by executing null.x) one of these two secuences of events will take place:
- The error will be logged in in the console, in the terminal log and in a notification to the user. The state remains as it was before the action was executed, the ticket is still displayed to the user. No synchronization message is sent to the backend, no order is created.
- The error is not logged anywhere (console, terminal log, notification). The state remains as it was before the action was executed, the ticket is still displayed to the user. A synchronization message is sent to the backend, an order will be created.

The second case only happens rarely, but when it does it will result on duplicated tickets being sent to the backend, because if the user is still working in the frontend with a ticket that has already been processed in the backend.
TO BE DONE
No tags attached.
blocks defect 0050552 closed cberner Cashup is not properly persisted between a day and the next 
Issue History
2022-10-17 11:30AugustoMauchTypedefect => backport
2022-10-17 11:30AugustoMauchTarget Version => 22Q3.2
2022-10-27 13:34hgbotNote Added: 0142657
2022-10-27 13:59hgbotResolutionopen => fixed
2022-10-27 13:59hgbotStatusscheduled => closed
2022-10-27 13:59hgbotFixed in Version => 22Q3.2
2022-10-27 13:59hgbotNote Added: 0142661
2022-10-27 13:59hgbotNote Added: 0142662
2022-11-07 13:55cbernerAssigned ToTriage Platform Base => cberner

Notes
(0142657)
hgbot   
2022-10-27 13:34   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1321 [^]
(0142661)
hgbot   
2022-10-27 13:59   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 0394e3ac2430e8032ddbfe07aec14768da9f3566
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 27-10-2022 13:33:33
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/0394e3ac2430e8032ddbfe07aec14768da9f3566 [^]

Fixes ISSUE-50554: Add missing awaits for cashup posthooks and some extra log

Adds useful log on entering the logout user-action and when finishing it, the current state
cashup id and the previously persisted one are logged.

---
M web-jspack/org.openbravo.pos2/src/model/session/Session.js
M web-jspack/org.openbravo.pos2/src/model/user-interface/__test__/FinishCashupUserAction.test.js
M web-jspack/org.openbravo.pos2/src/model/user-interface/user-actions/cashup/CashupUtils.js
M web-jspack/org.openbravo.pos2/src/model/user-interface/user-actions/cashup/FinishCashup.js
M web-jspack/org.openbravo.pos2/src/model/user-interface/user-actions/initialCount/ClearInitialCountInProgress.js
---
(0142662)
hgbot   
2022-10-27 13:59   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1321 [^]