Bug 1967108

Summary: AsyncComponent loader comparison may result in false positive
Product: OpenShift Container Platform Reporter: Rastislav Wagner <rawagner>
Component: Management ConsoleAssignee: Rastislav Wagner <rawagner>
Status: CLOSED ERRATA QA Contact: Siva Reddy <schituku>
Severity: medium Docs Contact:
Priority: high    
Version: 4.7CC: aos-bugs, jhadvig, jokerman, spadgett, yapei
Target Milestone: ---   
Target Release: 4.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-18 17:32:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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