Bug 1967108 - AsyncComponent loader comparison may result in false positive
Summary: AsyncComponent loader comparison may result in false positive
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.7
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 4.9.0
Assignee: Rastislav Wagner
QA Contact: Siva Reddy
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-02 12:52 UTC by Rastislav Wagner
Modified: 2021-10-18 17:33 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 17:32:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 9775 0 None None None 2021-08-10 16:51:51 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:33:02 UTC

Description Rastislav Wagner 2021-06-02 12:52:21 UTC
Description of problem:
AsyncComponent is using toString to compare loader prop https://github.com/openshift/console/blob/master/frontend/public/components/utils/async.tsx#L11

in case of dynamic plugin coderef, the toString always returns
() => __awaiter(void 0, void 0, void 0, function* () { return loadReferencedObject(ref, entryModule, pluginID, errorCallback); })

which causes AsyncComponent to not reload the loader because sameLoader returns false positive

Version-Release number of selected component (if applicable):
4.8

How reproducible:
always


Steps to Reproduce:
1. add two `console.page/resource/list` extensions to dynamic plugin 
2. add two `console.navigation/resource-ns` which will reference the list pages from step 1
3. try switching the pages from the navigation - the URL changes but component does not

Actual results:
AsyncComponent does not use the new loader causing page to not rerender

Expected results:
page rerenders

Comment 1 Jakub Hadvig 2021-06-02 14:24:42 UTC
Putting the issue on medium since its only effecting dynamic-plugins which are tech-preview.

Comment 3 Jakub Hadvig 2021-06-02 14:28:58 UTC
Unsetting the version since this fix should be moved to 4.9

Comment 7 Siva Reddy 2021-08-23 21:58:43 UTC
ClusterVersion:
  4.9.0-0.nightly-2021-08-22-070405

Steps to verify:
1. add two `console.page/resource/list` extensions to dynamic plugin 
2. add two `console.navigation/resource-ns` which will reference the list pages from step 1
3. try switching the pages from the navigation - the URL changes but component does not

   Now page re-renders.

Comment 10 errata-xmlrpc 2021-10-18 17:32:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:3759


Note You need to log in before you can comment on or make changes to this bug.