Openbravo Issue Tracking System - POS2
View Issue Details
0056377POS2Corepublic2024-09-05 11:562025-02-23 18:44
AugustoMauch 
AugustoMauch 
normalcriticalhave not tried
closedfixed 
5
 
 
approved
No
No
0056377: Management of inconsistent application state should be properly addressed in core2 applications
From time to time, the application state gets inconsistent, apparently not reflecting the current state of the application but a previous one.

We looking for those inconsistencies on a case-to-case basis, and introducing mitigation measures on a case-to-case basis as well.

This mechanism should be improved, so that if any inconsistency is found, all the application state modules should be re-initialized properly.
-
No tags attached.
depends on backport 005796325Q1 closed AugustoMauch POS2 Management of inconsistent application state should be properly addressed in core2 applications 
depends on backport 005796424Q4.1 closed AugustoMauch POS2 Management of inconsistent application state should be properly addressed in core2 applications 
related to feature request 0056730 closed ranjith_qualiantech_com POS2 Management of inconsistent application state should be properly addressed in EnyoPOS 
related to feature request 0054707 new AugustoMauch Retail Modules Add support to select the state persistence method (localstorage vs indexed db) 
related to defect 0054743 closed sreehari Retail Modules When the state persistence fails, the information of the cashup becomes outdated, and this can lead to data corruption 
related to defect 0056263 closed ranjith_qualiantech_com Retail Modules Mitigation https://issues.openbravo.com/view.php?id=52070 [^] should not create a new cashup in POS 
related to backport 005207023Q2 closed meriem_azaf POS2 Cashup mitigation: do not check if current cashup is the last one processed, just check if it is processed 
related to defect 0056246 closed sreehari POS2 Implement second Mitigation for duplicating document sequence number 
related to backport 0057438 closed AugustoMauch POS2 Management of inconsistent application state should be properly addressed in core2 applications 
causes defect 0058004 closed cberner POS2 Login blocked because of an error related to an inconsistent state 
causes defect 0058000 closed cberner POS2 POS2 is blocked after a logout and login with an Order loaded 
Issue History
2024-09-05 11:56AugustoMauchNew Issue
2024-09-05 11:56AugustoMauchAssigned To => AugustoMauch
2024-09-05 11:56AugustoMauchOBNetwork customer => No
2024-09-05 11:56AugustoMauchTriggers an Emergency Pack => No
2024-09-05 12:03AugustoMauchStatusnew => scheduled
2024-09-17 09:23PracticsIssue Monitored: Practics
2024-10-06 12:55hgbotMerge Request Status => open
2024-10-06 12:55hgbotNote Added: 0170023
2024-10-06 12:57hgbotNote Added: 0170024
2024-10-06 13:00hgbotNote Added: 0170025
2024-10-10 11:51AugustoMauchSummaryManagement of inconsistent application state should be properly addressed => Management of inconsistent application state should be properly addressed in core2 applications
2024-10-10 11:52AugustoMauchIssue cloned0056730
2024-10-10 11:55AugustoMauchRelationship addedrelated to 0056730
2024-10-10 13:26eugeniIssue Monitored: eugeni
2024-10-31 13:04malsasuaRelationship addedrelated to 0054707
2024-10-31 13:10malsasuaRelationship addedrelated to 0054743
2024-10-31 13:10malsasuaRelationship addedrelated to 0056263
2024-10-31 13:11malsasuaRelationship addedrelated to 0052070
2024-10-31 13:17malsasuaRelationship addedrelated to 0056246
2024-11-12 23:44hgbotNote Added: 0171833
2024-11-14 11:42hgbotMerge Request Statusopen => approved
2024-12-12 11:42AugustoMauchIssue cloned0057438
2024-12-12 11:42AugustoMauchRelationship addedrelated to 0057438
2025-02-12 23:20hgbotNote Added: 0175550
2025-02-12 23:20hgbotNote Added: 0175551
2025-02-12 23:23hgbotResolutionopen => fixed
2025-02-12 23:23hgbotStatusscheduled => closed
2025-02-12 23:23hgbotFixed in Version => RR25Q2
2025-02-12 23:23hgbotNote Added: 0175552
2025-02-12 23:23hgbotNote Added: 0175553
2025-02-12 23:24hgbotNote Added: 0175554
2025-02-12 23:24hgbotNote Added: 0175555
2025-02-12 23:25hgbotFixed in VersionRR25Q2 => 25Q2
2025-02-12 23:25hgbotNote Added: 0175556
2025-02-12 23:25hgbotNote Added: 0175557
2025-02-12 23:25AugustoMauchStatusclosed => new
2025-02-12 23:25AugustoMauchResolutionfixed => open
2025-02-12 23:25AugustoMauchFixed in Version25Q2 =>
2025-02-12 23:25AugustoMauchStatusnew => scheduled
2025-02-13 10:02hgbotNote Added: 0175578
2025-02-13 10:14AugustoMauchStatusscheduled => resolved
2025-02-13 10:14AugustoMauchResolutionopen => fixed
2025-02-13 10:14AugustoMauchStatusresolved => closed
2025-02-17 14:00cbernerRelationship addedcauses 0058004
2025-02-18 10:16cbernerRelationship addedcauses 0058000
2025-02-23 18:44hgbotNote Added: 0176037

Notes
(0170023)
hgbot   
2024-10-06 12:55   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1604 [^]
(0170024)
hgbot   
2024-10-06 12:57   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/755 [^]
(0170025)
hgbot   
2024-10-06 13:00   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1699 [^]
(0171833)
hgbot   
2024-11-12 23:44   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/3091 [^]
(0175550)
hgbot   
2025-02-12 23:20   
Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: fc0b7d1ce639d92032070372b3fb405f28919a64
Author: André Montenegro <a.montenegro@orisha.com>
Date: 12-02-2025 22:19:58
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.pos2/-/commit/fc0b7d1ce639d92032070372b3fb405f28919a64 [^]

Related to ISSUE-56377: created intercept in logInProcess to avoid backOffice checks for ticket and cashup ID

The state persistence check cannot be done when running CI, because in the cypress tests there is a
mechanism that reuses previous states in order to skip having to login very often

---
M web-jspack/org.openbravo.pos2/src-test/cypress/support/logIn.js
---
(0175551)
hgbot   
2025-02-12 23:20   
Merge request merged: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/3091 [^]
(0175552)
hgbot   
2025-02-12 23:23   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: 2744d5990b24c481764b4de2a3862cdb367ebb66
Author: Augusto Mauch <amauch@orisha.com>
Date: 12-02-2025 23:22:54
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/2744d5990b24c481764b4de2a3862cdb367ebb66 [^]

Fixes ISSUE-56377: Merge branch 'fr/56377-state-mitigation'

---
A src/org/openbravo/mobile/core/process/ApplicationStateCheck.java
A src/org/openbravo/mobile/core/process/ApplicationStateChecker.java
M src-db/database/sourcedata/OBMOBC_SERVICES.xml
M web/org.openbravo.mobile.core/app/model/application-state/StatePersistence.js
---
(0175553)
hgbot   
2025-02-12 23:23   
Merge request merged: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/755 [^]
(0175554)
hgbot   
2025-02-12 23:24   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: fd690143066489ce64c68d5fa014cb1b1c3e2771
Author: Augusto Mauch <amauch@orisha.com>
Date: 12-02-2025 23:23:44
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/fd690143066489ce64c68d5fa014cb1b1c3e2771 [^]

Fixes ISSUE-56377: Merge branch 'fr/56377-state-mitigation'

---
A src/org/openbravo/retail/posterminal/statechecker/CashupStateChecker.java
A src/org/openbravo/retail/posterminal/statechecker/TicketStateChecker.java
---
(0175555)
hgbot   
2025-02-12 23:24   
Merge request merged: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1699 [^]
(0175556)
hgbot   
2025-02-12 23:25   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 9cf77cc5f0dbc50fb83ffdd920e42a4820b58441
Author: Augusto Mauch <amauch@orisha.com>
Date: 12-02-2025 23:24:37
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.core2/-/commit/9cf77cc5f0dbc50fb83ffdd920e42a4820b58441 [^]

Fixes ISSUE-56377: Merge branch 'fr/56377-state-mitigation'

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M web-jspack/org.openbravo.core2/src/authentication/loginInitActions.js
---
(0175557)
hgbot   
2025-02-12 23:25   
Merge request merged: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1604 [^]
(0175578)
hgbot   
2025-02-13 10:02   
Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 37405a40f99f1d5c9bf3f24c1821d69eee561a68
Author: Augusto Mauch <amauch@orisha.com>
Date: 13-02-2025 10:02:07
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.core2/-/commit/37405a40f99f1d5c9bf3f24c1821d69eee561a68 [^]

Related to ISSUE-56377: Fixes test

---
M web-jspack/org.openbravo.core2/src/authentication/loginInitActions.js
---
(0176037)
hgbot   
2025-02-23 18:44   
Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 92e0ba54f465b627a1acb80b211bbdb682be2bec
Author: Augusto Mauch <a.mauch@orisha.com>
Date: 23-02-2025 18:18:56
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.core2/-/commit/92e0ba54f465b627a1acb80b211bbdb682be2bec [^]

Fixes ISSUE-57963: Global mitigation of state related problems

On each login, the local state is checked, and if it is determined that the state is not valid, it will
be reset.

This code references non-core2 concepts (Ticket, Cashup). It was done intentionally, this code should be
temporary and be removed once we find out the root cause of the back-to-the-past state problems. Instead
of implementing some infra to be able to add the relevant portion of the state to the request payload, it
is hardcoded for now

[stateMitigation] Adds missing adminMode when checking the state validity

[stateMitigation] Properly fail when in offline mode the stateValidity request

[stateMitigation] Use OB.App.reload api instead of manual location reload

Related to ISSUE-56377: Fixes test

Fixes ISSUE-58004: Login blocked because of an error related to an inconsistent state

The checkStateValidity function was not taking into account empty ticket
object or a missing cashup id.

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M web-jspack/org.openbravo.core2/src/authentication/loginInitActions.js
---