Openbravo Issue Tracking System - POS2
View Issue Details
0055794POS2POSpublic2024-04-26 08:082024-06-19 15:50
marvintm 
Rajesh_18 
normalmajorhave not tried
closedfixed 
5
 
24Q1.3 
approved
marvintm
Gold
96264
No
0055794: Error while importing generated when doing the cashup, if the connection is lost at a certain point in the process
It is possible for an Error While importing to happen in certain conditions when doing the cashup, if the connection is lost in some specific moment in time.

When this happens, the terminal will go offline, and once it is online again, the user can trigger the cashup completion again, causing an EWI due to a wrong cashup that is containing the same ids that the previously completed cashup also had.
- Login in the POS and do some sales.
- Go to the Cashup window, and count the payment methods (leaving no difference).
- When you reach the last step, add a breakpoint in this function, inside the FinishCashup.js file, in dev tools:
function addCashupId(payload) {
  return { ...payload, cashupId: OB.App.State.getState().Cashup.id };
}
- Then execute the cashup. The process will stop in the breakpoint you just added
- Go to dev tools/Network panel, and set the connectivity to "Without connection"
- Continue the process. The user action will fail as there is some post hook that requires connection
- Enable connectivity again.
- In the POS, change the terminal to online (it will work now because you just enabled connectivity).
- Now, realize you can complete the cashup again. Click on the "Finish" button again.
- Go to the back office. Verify that you now have an Error While Importing with the following message:

org.openbravo.base.exception.OBException: Cashup cannot be processed since error occurred in CashClose: A different object with the same identifier value was already associated with the session : [FIN_Reconciliation#590A06CCA2E08FD9EE354472E0ED81F1]
    at org.openbravo.retail.posterminal.ProcessCashClose.doReconciliationAndInvoices(ProcessCashClose.java:525)
    at org.openbravo.retail.posterminal.ProcessCashClose.saveRecord(ProcessCashClose.java:222)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.saveRecord(DataSynchronizationProcess.java:214)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:165)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:97)
    at org.openbravo.mobile.core.process.MobileImportEntryProcessorRunnable.processEntry(MobileImportEntryProcessorRunnable.java:55)
    at
Most probably the easiest solution is to review all postHooks of the action, and make sure we have proper fallbacks for all the cases where a remote request is triggered, so that the user action itself cannot fail if connection is lost at that moment.
No tags attached.
blocks defect 0055331 closed Rajesh_18 Error while importing generated when doing the cashup, if the connection is lost at a certain point in the process 
Issue History
2024-06-19 13:04marvintmTypedefect => backport
2024-06-19 13:04marvintmTarget Version => 24Q1.3
2024-06-19 15:44hgbotNote Added: 0166100
2024-06-19 15:50hgbotNote Added: 0166102
2024-06-19 15:50hgbotResolutionopen => fixed
2024-06-19 15:50hgbotStatusscheduled => closed
2024-06-19 15:50hgbotNote Added: 0166103

Notes
(0166100)
hgbot   
2024-06-19 15:44   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/merge_requests/123 [^]
(0166102)
hgbot   
2024-06-19 15:50   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/merge_requests/123 [^]
(0166103)
hgbot   
2024-06-19 15:50   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions [^]
Changeset: 3fe5e5875098e04a35156828351402b02d4070dc
Author: Rajesh Senthilkumar <rajesh@qualiantech.com>
Date: 19-06-2024 19:13:08
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/commit/3fe5e5875098e04a35156828351402b02d4070dc [^]

Fixed ISSUE-55794: Added try-catch for mobile service request

---
M web-jspack/org.openbravo.retail.sessions/src/model/till/actions/CloseTillInServer.js
---