Openbravo Issue Tracking System - POS2
View Issue Details
0053994POS2Corepublic2023-10-18 23:132023-11-22 17:11
AugustoMauch 
AugustoMauch 
immediatecriticalhave not tried
closedfixed 
5
 
23Q4.123Q4.1 
No
0053994: Updating the sources in a terminal may result in duplicated document numbers
A terminal that was loaded a new version of the POS2 sources is likely to create ticket with duplicated numbers right after the update.

This happens because when sources are updated, the state of the application is reset (see [1] and [2]. Part of the reset state would have contained the document number sequences. If they are not available in the state, the POS will initialize them from the terminal. Since the terminal is not updated on every login but only right after each master data refresh, it could be that the document numbers read from the terminal are outdated, and as a consequence the POS would create tickets with duplicated document numbers.

[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/blob/master/web-jspack/org.openbravo.core2/src/registerServiceWorker.js#L71 [^]
[2] https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/blob/master/web/org.openbravo.mobile.core/app/model/application-state/StatePersistence.js#L361 [^]
- Open POS in livebuilds: https://livebuilds.openbravo.com/context/retail_pos2_pgsql/web/pos/?terminal=VBS-2 [^]
- Create a few tickets. Check their document number in the backoffice
- Logout in the POS
- Execute this in the debugger console to simulate a source upgrade, then refresh the browser and log in again: OB.UTIL.localStorage.removeItem('stateIsConsistentWithLocalStorage')
- Create some more tickets. Check in the backoffice that the latest tickets were created with document numbers that had already been used.
No tags attached.
blocks defect 0053708 closed AugustoMauch Updating the sources in a terminal may result in duplicated document numbers 
Issue History
2023-11-22 08:26AugustoMauchTypedefect => backport
2023-11-22 08:26AugustoMauchTarget Version => 23Q4.1
2023-11-22 08:37hgbotNote Added: 0157445
2023-11-22 08:38hgbotNote Added: 0157446
2023-11-22 16:47hgbotResolutionopen => fixed
2023-11-22 16:47hgbotStatusscheduled => closed
2023-11-22 16:47hgbotNote Added: 0157497
2023-11-22 16:47hgbotNote Added: 0157498
2023-11-22 16:47hgbotFixed in Version => 23Q4.1
2023-11-22 16:47hgbotNote Added: 0157499
2023-11-22 16:47hgbotNote Added: 0157500
2023-11-22 17:11hgbotNote Added: 0157502

Notes
(0157445)
hgbot   
2023-11-22 08:37   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1290 [^]
(0157446)
hgbot   
2023-11-22 08:38   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/640 [^]
(0157497)
hgbot   
2023-11-22 16:47   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/640 [^]
(0157498)
hgbot   
2023-11-22 16:47   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: 5e79b9c9309bf3c05217b7e9831028dc785debfd
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 22-11-2023 08:37:54
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/5e79b9c9309bf3c05217b7e9831028dc785debfd [^]

Related to ISSUE-53994: Add a new condition to incremental refresh so it can be forced after updating the sources

---
M web/org.openbravo.mobile.core/app/model/masterdata/MasterdataController.js
---
(0157499)
hgbot   
2023-11-22 16:47   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 9369aa0ed5d4562b42f6f37d1a1aa21e48c837ab
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 22-11-2023 08:36:23
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/9369aa0ed5d4562b42f6f37d1a1aa21e48c837ab [^]

Fixes ISSUE-53994: Force an incremental refresh after updating sources to update the terminal info

When sources are updated, the state of the application is reset. Some properties of the state are then initialized using information
from the terminal object, so the terminal must be updated to ensure the initialization is done with updated information

---
M web-jspack/org.openbravo.core2/src/registerServiceWorker.js
M web-jspack/org.openbravo.core2/src/serviceWorkerRegistration.js
---
(0157500)
hgbot   
2023-11-22 16:47   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1290 [^]
(0157502)
hgbot   
2023-11-22 17:11   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/customers/saboraespana/snapshots [^]
Changeset: 388f3356e71aeea5bcab5dc7bdd9e71aba430a00
Author: Alfonso Alcalde Elorz <alfonso.alcalde@openbravo.com>
Date: 22-11-2023 17:10:56
URL: https://gitlab.com/openbravo/customers/saboraespana/snapshots/-/commit/388f3356e71aeea5bcab5dc7bdd9e71aba430a00 [^]

Update Snapshot_Dev_23Q4, Fixed ISSUE-53994, task SESP-93
---
M delivery/dev/Snapshot_Dev_23Q4
---