Openbravo Issue Tracking System - Openbravo ERP | |||||||||||||
View Issue Details | |||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
0050421 | Openbravo ERP | A. Platform | public | 2022-10-05 14:26 | 2022-10-05 14:32 | ||||||||
Reporter | vmromanos | ||||||||||||
Assigned To | Triage Platform Base | ||||||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||||||
Status | new | Resolution | open | ||||||||||
Platform | OS | 5 | OS Version | ||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Merge Request Status | |||||||||||||
Review Assigned To | |||||||||||||
OBNetwork customer | |||||||||||||
Web browser | |||||||||||||
Modules | Core | ||||||||||||
Support ticket | |||||||||||||
Regression level | |||||||||||||
Regression date | |||||||||||||
Regression introduced in release | |||||||||||||
Regression introduced by commit | |||||||||||||
Triggers an Emergency Pack | No | ||||||||||||
Summary | 0050421: Push API payload generation when event is triggered | ||||||||||||
Description | As far as I understand, right now the Push API works this way: 1. A push API event is triggered in the middle of a transaction, pointing to the object id. For example: SynchronizationEvent.getInstance() .triggerEvent("OBDOAPI_UpdateDOStatus", distributionOrder.getId()); 2. The transaction finishes 3. The EDL request is executed sending the PUSH API event to the listeners. In the moment it is sent, the payload is generated and sent outside. So the process is pure asynchronous, and this might lead to inconsistencies. Real example: We have two events related to Distribution Orders: * OBDOAPI_UpdateDOStatus --> which is triggered when a DO changes the status * OBDOAPI_UpdateDOQuantities --> which is triggered when any quantity in the DO changes when a goods movement is performed. See this real flow: 1. A DO is confirmed. 1.1 The OBDOAPI_UpdateDOStatus is launched with Confirmed status [OK] 2. A "skip delta" action is performed in the DO. This implies to do the following stuff in the same transaction: 2.1 to create a goods movement. The OBDOAPI_UpdateDOQuantities is launched and the status is Closed [WRONG, at this point the status is Confirmed] 2.2 to close the DO. The OBDOAPI_UpdateDOStatus is launched and the status is Closed [OK] So the problem is at 2.1, where I was expecting to receive the Confirmed status, because in the moment it was triggered that was the status. However, I'm receiving Closed status, because in the moment the EDL is executed, this is the status in the DB | ||||||||||||
Steps To Reproduce | Configure the preference AWO Close DO Issue automatically after Skip Delta = Y Create a DOi with one line of 10 units --> #1.json# OBDOAPI_UpdateDOStatus is launched with status Confirmed [OK] Generate the picking for 10 units and confirm it. Generate the issue task, and confirm 3 units from AWO Frontend. Important: select Skip delta. ---> #2.json# OBDOAPI_UpdateDOQuantities is launched with 3 units and status Closed [WRONG: I'm expecting Confirmed Status at this point] ---> #3.json# OBDOAPI_UpdateDOStatus is launched with 3 units and status Closed JSON files attached | ||||||||||||
Proposed Solution | When triggering the event, being able to indicate that I want to generate the payload at this exact moment, save it to the EDL, and use it when sending it to the subscribers. | ||||||||||||
Additional Information | |||||||||||||
Tags | No tags attached. | ||||||||||||
Relationships |
| ||||||||||||
Attached Files | refirstsmcpbug.zip (2,343) 2022-10-05 14:26 https://issues.openbravo.com/file_download.php?file_id=17588&type=bug | ||||||||||||
Issue History | |||||||||||||
Date Modified | Username | Field | Change | ||||||||||
2022-10-05 14:26 | vmromanos | New Issue | |||||||||||
2022-10-05 14:26 | vmromanos | Assigned To | => Triage Platform Base | ||||||||||
2022-10-05 14:26 | vmromanos | File Added: refirstsmcpbug.zip | |||||||||||
2022-10-05 14:26 | vmromanos | Modules | => Core | ||||||||||
2022-10-05 14:26 | vmromanos | Triggers an Emergency Pack | => No | ||||||||||
2022-10-05 14:27 | vmromanos | Relationship added | related to 0050249 | ||||||||||
2022-10-05 14:32 | vmromanos | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=24830#r24830 |
There are no notes attached to this issue. |