Openbravo Issue Tracking System - Retail Modules
View Issue Details
0053131Retail ModulesWeb POSpublic2023-07-28 14:342023-08-09 08:49
AugustoMauch 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
RR23Q1.4 
approved
No
No
0053131: SynchronizationBuffer.internalFlush does not flush all messages if some endpoints where currently syncing other messages
The internalFlush function of SynchronizationBuffer tries to synchronize all the messages from all the available endpoints. If an endpoint is already synchronizing previous messages, that endpoint will be skipped.

That function is invoked whenever new messages are added to the synchronization buffer, but also externally (i.e. to ensure all messages are synchronized before stopping the synchronization buffer when logging out).

It would be useful if, on demand, when internalFlush is executed and some endpoints are skipped because they were busy, it is recursively invoked a reasonable number of times until all messages are synchronized
This issue is difficult to reproduce, as it relies on a race condition (i.e. the backend endpoint being busy synchronizing terminal log messages when a user closes a cashup, resulting in the cashup not being synchronized until the next time the user logs in).

To help reproduce the issue:
- Install the attached sleepOnTerminalLog.diff patch. It contains commented out code that will result in the synchronized terminal log messages taking very long. Uncomment the code right after opening the cashup screen in pos2, if you do it before it will be difficult to use POS2.
- Open the Cashup window, move to the last step. Pay attention to the eclipse log, and the momento the "Sleeping" message is shown, complete the cashup. The user will be logged out, and if you check the synchronization buffer store in IndexedDB you will check that the message was not synchronized
No tags attached.
blocks defect 0053100 closed AugustoMauch SynchronizationBuffer.internalFlush does not flush all messages if some endpoints where currently syncing other messages 
Issue History
2023-08-02 11:26AugustoMauchTypedefect => backport
2023-08-02 11:26AugustoMauchTarget Version => RR23Q4
2023-08-02 11:26AugustoMauchTarget VersionRR23Q4 => RR23Q1.4
2023-08-02 14:05hgbotNote Added: 0153120
2023-08-09 08:49hgbotResolutionopen => fixed
2023-08-09 08:49hgbotStatusscheduled => closed
2023-08-09 08:49hgbotFixed in Version => RR23Q1.5
2023-08-09 08:49hgbotNote Added: 0153376
2023-08-09 08:49hgbotNote Added: 0153377

Notes
(0153120)
hgbot   
2023-08-02 14:05   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/587 [^]
(0153376)
hgbot   
2023-08-09 08:49   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: 52256fc05d72288fdce390971e64492bc9d0b5e8
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 02-08-2023 14:05:44
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/52256fc05d72288fdce390971e64492bc9d0b5e8 [^]

Fixes ISSUE-53131: SynchronizationBuffer.internalFlush does not ensure all messages are synchronized

Now, if the internalFlush method was executed and any of the endpoints were busy with previous synchronizations, it will be
recursively invoked after waiting for 500ms. The recursive calls will continue until none of the endpoints were busy or until
a maximum number of recursive calls (set to 10 for a total of a 5 second wait) is reached.

By default, internalFlush will behave as before, the new retry behaviour will only take place if its first param is passed to true

---
M web/org.openbravo.mobile.core/app/model/synchronization-buffer/SynchronizationBuffer.js
---
(0153377)
hgbot   
2023-08-09 08:49   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/587 [^]