Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0054931
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[POS2] Coremajorhave not tried2024-01-02 13:072024-03-21 18:29
ReporterjarmendarizView Statuspublic 
Assigned Tocberner 
PrioritynormalResolutionfixedFixed in Version24Q1.1
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version24Q1.2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0054931: Error page is not shown if the error occurs during registry process

DescriptionIn case the application has a blocking error, an error page defined in ErrorFallback.jsx is shown, but this page shows the company logo using the CompanyLogo component. If this error occurs during the registration process, where the State is not available yet, the Error page won't be shown and the user will encounter a blank screen.
Steps To Reproduce1- Force an error during the registration process. This can be achieved by adding the following in checkIsRegistered() function in Registry.js:

function checkIsRegistered(registry, name, type) {
  if (!_.has(registry, name) || name === 'OBC2_Logout') {
    throw Error(`${type} ${name} is not registered`);
  }
}

2- Open POS2 application in the browser. Instead of rendering the login page or the error page, a blank screen will appear and the following errors in the browser's console:

Uncaught Error: could not find react-redux context value; please ensure the component is wrapped in a <Provider>
    at useReduxContext (useReduxContext.js:24:1)
    at useSelector (useSelector.js:125:1)
    at CompanyLogo (CompanyLogo.jsx:31:1)
...
Proposed SolutionAdding a check in CompanyLogo to show no logo if the state information is not available, preventing the error situation. This way the error page will be shown at least even if it has no logo.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0054239 closedcberner Error page is not shown if the error occurs during registry process 

-  Notes
(0162520)
hgbot (developer)
2024-03-21 18:29

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1429 [^]
(0162521)
hgbot (developer)
2024-03-21 18:29

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1429 [^]
(0162522)
hgbot (developer)
2024-03-21 18:29

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: a58b549f98f1962a904a905c545150a41052593b
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 21-03-2024 18:28:45
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/a58b549f98f1962a904a905c545150a41052593b [^]

Fixes ISSUE-54931: Error page is not shown if the error occurs during registry process

The main problem was that CompanyLogo component is used in the
ErrorFallback component, and it makes use of redux state. When errors
happen in the initialization processes(registration of components, and
other initializations), the ErrorFallback component was being rendered
without any provider.

As a fix, even when there are registration errors, CompanyLogo is added
conditionally, if there's no state, it will not be added.

---
M web-jspack/org.openbravo.core2/src/components/ErrorFallback/ErrorFallback.jsx
---

- Issue History
Date Modified Username Field Change
2024-03-13 10:17 AugustoMauch Type defect => backport
2024-03-13 10:17 AugustoMauch Target Version => 24Q1.1
2024-03-18 14:32 cberner Target Version 24Q1.1 => 24Q1.2
2024-03-21 18:29 hgbot Note Added: 0162520
2024-03-21 18:29 hgbot Resolution open => fixed
2024-03-21 18:29 hgbot Status scheduled => closed
2024-03-21 18:29 hgbot Note Added: 0162521
2024-03-21 18:29 hgbot Fixed in Version => 24Q1.1
2024-03-21 18:29 hgbot Note Added: 0162522


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker