Bug 2013990 - Observe dashboard crashs on reload when perspective has changed (in another tab)
Summary: Observe dashboard crashs on reload when perspective has changed (in another tab)
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Dev Console
Version: 4.9
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.10.0
Assignee: Vikram Raj
QA Contact: spathak@redhat.com
Depends On:
Blocks: 2027804
TreeView+ depends on / blocked
Reported: 2021-10-14 08:41 UTC by Christoph Jerolimov
Modified: 2022-03-10 16:19 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2027804 (view as bug list)
Last Closed: 2022-03-10 16:19:35 UTC
Target Upstream Version:

Attachments (Terms of Use)
monitoring-crash-after-changing-perspective.mp4 (784.20 KB, video/mp4)
2021-10-14 08:43 UTC, Christoph Jerolimov
no flags Details

System ID Private Priority Status Summary Last Updated
Github openshift console pull 10526 0 None open Bug 2013990: use namespace instead of useActivePerspective hooks to get the variables in Observe dashboard 2021-11-22 13:22:24 UTC
Red Hat Product Errata RHSA-2022:0056 0 None None None 2022-03-10 16:19:54 UTC

Description Christoph Jerolimov 2021-10-14 08:41:53 UTC
Description of problem:
When the user opens the Observe > Dashboard in admin or developer perspective and switches the perspective in another tab, the observe dashboard crashs on reload.

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

How reproducible:

Steps to Reproduce:
1. Navigate to the Observe dashboard view
2. Select a dashboard
3. Open the console in another browser tab (right click in navigation > open in new tab)
4. Change the perspective in this new tab 
5. Switch back to the browser tab with the observe dashboard view and reload the browser tab

Actual results:
Content area crashs and shows "Oh no! Something went wrong."

  TypeError: Cannot read properties of undefined (reading 'value')
  in VariableDropdown (public/components/monitoring/dashboards/index.tsx:176)

Quick code analyse shows that the variable to get the query is not defined here:

  const VariableDropdown: React.FC<VariableDropdownProps> = ({ id, name }) => {
    const [activePerspective] = useActivePerspective();
    const timespan = useSelector(({ UI }: RootState) =>
      UI.getIn(['monitoringDashboards', activePerspective, 'timespan']),
    const variables = useSelector(({ UI }: RootState) =>
      UI.getIn(['monitoringDashboards', activePerspective, 'variables']),
    const variable = variables.toJS()[name];
    const query = evaluateTemplate(variable.query, variables, timespan);

The reason is that that the redux state ... => 'monitoringDashboards' => 'activePerspective => 'variables' is not initialized correctly.

Expected results:
No crash

Additional info:

Comment 2 Christoph Jerolimov 2021-10-14 08:45:55 UTC
Assigned this to Dev Console because this is an followup issue after consolidating the admin monitoring dashboard to devconsole monitoring dashboard (https://issues.redhat.com/browse/ODC-6068 / https://github.com/openshift/console/pull/9644)

Comment 4 Aritra Roy 2021-12-05 22:18:54 UTC
verified on firefox 90.0.2, build 4.10.0-0.nightly-2021-12-03-213835
following the steps to reproduce doesn't crash the console.

Comment 6 Karthik Jeeyar 2021-12-14 09:45:06 UTC
Since nightly builds are not having the changes from Nov 17th, We decided to QE verify the 4.10 issues on a ci build. Changing the perspective in another tab and refreshing the original tab no longer breaks the UI, so marking the ticket as Verified.

Verified on: 
cluster build: 4.10.0-0.ci-2021-12-14-050037

Comment 10 errata-xmlrpc 2022-03-10 16:19:35 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.10.3 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.


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