Openbravo Issue Tracking System - POS2
View Issue Details
0051234POS2POSpublic2022-12-22 17:212023-01-09 18:52
guilleaer 
meriem_azaf 
urgentcriticalhave not tried
closedfixed 
5
 
23Q1 
No
0051234: Cannot read properties of undefined (find) -> infinite loop and chrome crashes
Once an error is raised in the initialitation secuence the terminal becamos unusable and creates an infinite loop which finally consumes all the memory and makes chrome crash.

After some research I have the feeling that the problem comes from the terminal information which is stored in indexedDb (login DB)(User table)

The data stored there is corrupted because the terminal information stored there only have the property "terminalType" but none of the other properties of the terminal which should be there are present.

This info is used to restore the terminal so we start working with a terminal which is empty. It makes fail almost everything because almost all the code of pos2 is assming that terminal object is there properly filled.
1. Apply Patch (attached)
2. open erp and unlink your terminal
3. clear cache
4. Open POS
5. link your terminal and login
6. Login will be performed but at some point an error will appear on your screen. After accept login window will be shown
7. Enter user and password and login again
8. error -> Cannot read properties of undefined -> chrome enters in an infinite loop which breaks chrome
No tags attached.
related to defect 0050588 closed meriem_azaf Error shown in POS2 after updating the application 
diff find_reproducer.diff (1,585) 2022-12-22 17:21
https://issues.openbravo.com/file_download.php?file_id=17976&type=bug
png Selection_1161.png (29,599) 2022-12-22 17:51
https://issues.openbravo.com/file_download.php?file_id=17980&type=bug
png
Issue History
2022-12-22 17:21guilleaerNew Issue
2022-12-22 17:21guilleaerAssigned To => Triage Platform Base
2022-12-22 17:21guilleaerFile Added: find_reproducer.diff
2022-12-22 17:21guilleaerTriggers an Emergency Pack => No
2022-12-22 17:51guilleaerFile Added: Selection_1161.png
2022-12-23 10:20jarmendarizRelationship addedrelated to 0050588
2022-12-30 09:29AugustoMauchAssigned ToTriage Platform Base => meriem_azaf
2022-12-30 09:29AugustoMauchStatusnew => scheduled
2023-01-05 13:25hgbotNote Added: 0145183
2023-01-05 13:29hgbotNote Added: 0145184
2023-01-09 18:51hgbotResolutionopen => fixed
2023-01-09 18:51hgbotStatusscheduled => closed
2023-01-09 18:51hgbotFixed in Version => 23Q1
2023-01-09 18:51hgbotNote Added: 0145221
2023-01-09 18:51hgbotNote Added: 0145222
2023-01-09 18:52hgbotNote Added: 0145223
2023-01-09 18:52hgbotNote Added: 0145224

Notes
(0145183)
hgbot   
2023-01-05 13:25   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1443 [^]
(0145184)
hgbot   
2023-01-05 13:29   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/953 [^]
(0145221)
hgbot   
2023-01-09 18:51   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 76fbb536794ca612a0a0b474b1414efe41484011
Author: Meriem Azaf <meriem.azaf@openbravo.com>
Date: 05-01-2023 15:42:18
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/76fbb536794ca612a0a0b474b1414efe41484011 [^]

Fixes ISSUE-51234: Cannot read properties of undefined (find) -> infinite loop and chrome crashes

Once an error is raised in the initialitation sequence the terminal becomes unusable and creates an infinite loop which finally consumes all the memory and makes chrome crash.

The problem was, on login, terminal info is loaded after completing the master data load so after the user is sent back to the login screen before terminal data is loaded so the terminal info is not loaded also.

To fix this, when there is a failure on an updateFunction after doing a master data refresh, we have to ensure next time user logs in the master data load is run again OB.UTIL.localStorage.removeItem('MasterdataLastTotalRefresh') and OB.UTIL.localStorage.removeItem('MasterdataLastIncrementalRefresh');

---
M web-jspack/org.openbravo.core2/src/core/ConfigurationSet.js
M web-jspack/org.openbravo.core2/src/core/Registry.js
---
(0145222)
hgbot   
2023-01-09 18:51   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/953 [^]
(0145223)
hgbot   
2023-01-09 18:52   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 3b9c182bfb1011dfaf14595130a34a13fd653d1e
Author: Meriem Azaf <meriem.azaf@openbravo.com>
Date: 09-01-2023 17:49:13
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/3b9c182bfb1011dfaf14595130a34a13fd653d1e [^]

Fixes ISSUE-51234: Cannot read properties of undefined (find) -> infinite loop and chrome crashes

Once an error is raised in the initialitation sequence the terminal becomes unusable and creates an infinite loop which finally consumes all the memory and makes chrome crash.

The problem was, on login, terminal info is loaded after completing the master data load so after the user is sent back to the login screen before terminal data is loaded so the terminal info is not loaded also.

To fix this, when there is a failure on an updateFunction after doing a master data refresh, we have to ensure next time user logs in the master data load is run again OB.UTIL.localStorage.removeItem('MasterdataLastTotalRefresh') and OB.UTIL.localStorage.removeItem('MasterdataLastIncrementalRefresh');

---
M web-jspack/org.openbravo.pos2/src/model/ticket/user-actions/ReturnBlindTicket.js
---
(0145224)
hgbot   
2023-01-09 18:52   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1443 [^]