Openbravo Issue Tracking System - POS2 |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0050314 | POS2 | Core | public | 2022-09-22 16:21 | 2022-10-11 12:25 |
|
Reporter | cberner | |
Assigned To | cberner | |
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 23Q1 | |
Merge Request Status | approved |
Review Assigned To | AugustoMauch |
OBNetwork customer | No |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0050314: State compression on occasions breaks the state on deployed pos2 |
Description | If we refresh pos2 without any previous state and no data of the application, it breaks with the following error continuously appearing in the terminal:
TypeError: Cannot read properties of undefined (reading 'length')
at Object.checkMaximumNumberEventsPerMessage (POS2.js:16745:30)
If we take a look at the state after this happens, we encounter a state that is semi-compressed, and this seems to be the thing that's generating that error. It is not very clear what is causing it, for now we know is not the service workers, as this also happens on locally node deployed pos2.
Check the attached screenshot and video for more details. |
Steps To Reproduce | 1. Go to pos2 in livebuilds: https://livebuilds.openbravo.com/retail_pos2_pgsql/web/pos/?terminal=VBS-2 [^]
2. Open developer tools in chrome, and go to tab "Application"
3. Click on the left, click on Storage, and then on the button "Clear site data"
Refresh the web, you should reproduce the problem. Check the attached gif for extra info. |
Proposed Solution | |
Additional Information | |
Tags | No tags attached. |
Relationships | depends on | backport | 0050478 | RR22Q4.1 | closed | cberner | Retail Modules | State compression on occasions breaks the state on deployed pos2 | depends on | backport | 0050479 | RR22Q3.2 | closed | cberner | Retail Modules | State compression on occasions breaks the state on deployed pos2 |
|
Attached Files | errorCompression.png (112,986) 2022-09-22 16:21 https://issues.openbravo.com/file_download.php?file_id=17540&type=bug

semiCompressedState.png (264,496) 2022-09-22 16:21 https://issues.openbravo.com/file_download.php?file_id=17541&type=bug
errorsCompression.gif (1,398,761) 2022-09-22 16:22 https://issues.openbravo.com/file_download.php?file_id=17542&type=bug |
|
Issue History |
Date Modified | Username | Field | Change |
2022-09-22 16:21 | cberner | New Issue | |
2022-09-22 16:21 | cberner | Assigned To | => Triage Platform Base |
2022-09-22 16:21 | cberner | File Added: errorCompression.png | |
2022-09-22 16:21 | cberner | OBNetwork customer | => No |
2022-09-22 16:21 | cberner | Triggers an Emergency Pack | => No |
2022-09-22 16:21 | cberner | File Added: semiCompressedState.png | |
2022-09-22 16:22 | cberner | File Added: errorsCompression.gif | |
2022-10-03 16:14 | andre_montenegro | Note Added: 0141581 | |
2022-10-06 12:02 | cberner | Note Added: 0141722 | |
2022-10-07 11:46 | hgbot | Merge Request Status | => open |
2022-10-07 11:46 | hgbot | Note Added: 0141849 | |
2022-10-07 13:46 | cberner | Assigned To | Triage Platform Base => cberner |
2022-10-07 13:46 | cberner | Status | new => scheduled |
2022-10-10 18:50 | hgbot | Merge Request Status | open => approved |
2022-10-10 18:52 | hgbot | Resolution | open => fixed |
2022-10-10 18:52 | hgbot | Status | scheduled => closed |
2022-10-10 18:52 | hgbot | Fixed in Version | => RR23Q1 |
2022-10-10 18:52 | hgbot | Note Added: 0141933 | |
2022-10-10 18:52 | hgbot | Note Added: 0141934 | |
2022-10-11 12:23 | cberner | Status | closed => new |
2022-10-11 12:23 | cberner | Resolution | fixed => open |
2022-10-11 12:23 | cberner | Fixed in Version | RR23Q1 => |
2022-10-11 12:24 | cberner | Status | new => scheduled |
2022-10-11 12:25 | cberner | Status | scheduled => resolved |
2022-10-11 12:25 | cberner | Fixed in Version | => 23Q1 |
2022-10-11 12:25 | cberner | Resolution | open => fixed |
2022-10-11 12:25 | cberner | Review Assigned To | => AugustoMauch |
2022-10-11 12:25 | cberner | Status | resolved => closed |
Notes |
|
|
|
|
|
|
|
(0141849)
|
hgbot
|
2022-10-07 11:46
|
|
|
|
(0141933)
|
hgbot
|
2022-10-10 18:52
|
|
Directly closing issue as related merge request is already approved.
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: d2cd412b1fcf55901e3f897bbe9f583170b29d01
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 10-10-2022 18:52:03
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/d2cd412b1fcf55901e3f897bbe9f583170b29d01 [^]
Fixes ISSUE-50314: State persistence compression breaks in occasions on pos2
This was due to how the compressed state is saved in the localstorage.
If the localstorage is cleaned while in the application, being it in the
login screen or in another part of the application, that would result in
the state being persisted just after clearing localstorage.
After a refresh, this state saved in the localstorage would result in an
error, because we would try to compress the already compressed state
again, which is wrong. To fix this, we're checking if the property in
the state "isGlobalState" exists and is of boolean type, then the state
is not compressed. We can assume this, because the property is always
available as part of the main state and when compressed it is a string
instead of a boolean variable.
---
M web/org.openbravo.mobile.core/app/model/application-state/StatePersistence.js
---
|
|
|
(0141934)
|
hgbot
|
2022-10-10 18:52
|
|
|