Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect dashboard opens when clicking on dashboard title #25064

Closed
3 tasks
zhaorui2022 opened this issue Aug 23, 2023 · 9 comments · Fixed by #25074
Closed
3 tasks

Incorrect dashboard opens when clicking on dashboard title #25064

zhaorui2022 opened this issue Aug 23, 2023 · 9 comments · Fixed by #25074

Comments

@zhaorui2022
Copy link
Contributor

In the dashboard list, when clicking on some dashboards, sometimes incorrect dashboard is open. See screen record for details.

How to reproduce the bug

It doesn't always happen but reproducible.

  1. Go to Dashboard page
  2. Click on a dashboard and go back
  3. Then click on another dashboard
  4. See incorrect dashboard

Expected results

It always opens the dashboard I select

Actual results

Sometimes it opens the previous dashboard

Screenshots

Google Chrome - Superset 2023-08-23 at 10 39 58 AM

Environment

(please complete the following information):

  • browser type and version: chrome, Version 112.0.5615.121 (Official Build) (arm64)
  • superset version: superset version 3.0.0rc2
  • python version: python --version python 3.9
  • node.js version: node -v
  • any feature flags active: Not sure if it is related, but we have dashboard native filter and cross filter off (inherited from superset/config in 3.0.0rc2) Before 3.0.0rc2, we didn't have dashboard native filter enabled.

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Not quite sure if these are related but I see such stack trace in browser console

tChartIdsInFilterScope.ts:31 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'excluded')
    at getChartIdsInFilterScope.ts:31:20
    at Array.filter (<anonymous>)
    at i (getChartIdsInFilterScope.ts:29:19)
    at g (crossFilters.ts:58:24)
    at hydrate.js:313:9
    at index.js:16:18
    at DashboardPage.tsx:229:9
    at DashboardPage.tsx:241:13
    at il (react-dom.production.min.js:211:320)
    at Oc (react-dom.production.min.js:257:303)
(
@michael-s-molina
Copy link
Member

@zhaorui2022 I was not able to reproduce this bug using the 3.0.0 RC2 test environment.

Screen.Recording.2023-08-23.at.16.01.14.mov

@michael-s-molina
Copy link
Member

michael-s-molina commented Aug 23, 2023

I noticed the problem always happen when you click on the DB tests dashboard. Maybe it's related to this dashboard? Are you able to generate this error when interacting with the examples dashboard?

@michael-s-molina
Copy link
Member

michael-s-molina commented Aug 23, 2023

I believe the exception you posted might be related to the bug. Could you edit the dashboard, to go Edit properties, and paste the contents of the Advanced tab? The error indicates a problem with your filter scopes.

@zhaorui2022
Copy link
Contributor Author

When I reopen the browser and reopen the dashboard directly without clicking on anything else, it does show an error in the console.

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'excluded')
    at getChartIdsInFilterScope.ts:31:20
    at Array.filter (<anonymous>)
    at i (getChartIdsInFilterScope.ts:29:19)
    at g (crossFilters.ts:58:24)
    at hydrate.js:313:9
    at index.js:16:18
    at DashboardPage.tsx:229:9
    at DashboardPage.tsx:241:13
    at il (react-dom.production.min.js:211:320)
    at Oc (react-dom.production.min.js:257:303)
(

However, I am not able to click on edit dashboard for this one due to this error causing the entire page not loading. And then if I go back to the list of dashboards, the same issue happens. So maybe it is related with the error showing up in the console.

@zhaorui2022
Copy link
Contributor Author

Oh I just saw this config is set to True https://github.com/apache/superset/blob/3630d6844c0f4668f7196beadd744e582c9219bd/superset/config.py#L443C37-L443C37 while the previous version I tested had it set to False by default. Let me disabling this feature and see if it works.

@zhaorui2022
Copy link
Contributor Author

zhaorui2022 commented Aug 23, 2023

Confirming after disabling DASHBOARD_CROSS_FILTER feature flag, the issue is gone.

So it seems somehow https://github.com/kgabryje/incubator-superset/blame/44e4fb1090c247121f77d7e4a03e99e715699ea8/superset-frontend/src/dashboard/util/crossFilters.ts#L59 returns undefined for the dashboard.

@michael-s-molina
Copy link
Member

@zhaorui2022 It's just that if you disable DASHBOARD_CROSS_FILTER that part of the code won't execute. The 3.0.0RC2 test environment has DASHBOARD_CROSS_FILTER enabled and I can't reproduce this error. What I think it's happening is that your dashboard configuration is corrupted for that particular dashboard and that is causing the error.

Can you disable DASHBOARD_CROSS_FILTER, execute the steps bellow and share your Advanced tab values?

I believe the exception you posted might be related to the bug. Could you edit the dashboard, to go Edit properties, and paste the contents of the Advanced tab? The error indicates a problem with your filter scopes.

@michael-s-molina
Copy link
Member

@zhaorui2022 I think I understood what was happening. If you create a dashboard with DASHBOARD_CROSS_FILTER disabled and later enable the feature flag, the error you mentioned will be thrown. I submitted #25074 to fix the issue.

@zhaorui2022
Copy link
Contributor Author

Thanks. The dashboard didn't have cross filter enabled. I will also cherry pick the commit and try in the test environment.

{
  "color_scheme": "",
  "refresh_frequency": 0,
  "expanded_slices": {},
  "label_colors": {},
  "timed_refresh_immune_slices": [],
  "cross_filters_enabled": false,
  "default_filters": "{}",
  "chart_configuration": {},
  "global_chart_configuration": {},
  "color_scheme_domain": [],
  "show_native_filters": true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants