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

Switching between tabs reruns queries even if filters are not modified #39863

Closed
ignacio-mb opened this issue Mar 8, 2024 · 12 comments
Closed
Assignees
Labels
Priority:P2 Average run of the mill bug .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Reporting/Dashboards .Reproduced Issues reproduced in test (usually Cypress) .Team/DashViz Dashboard and Viz team Type:Bug Product defects
Milestone

Comments

@ignacio-mb
Copy link
Contributor

ignacio-mb commented Mar 8, 2024

Describe the bug

Queries are being rerun when switching between tabs in 48.x, even though this is not the intended behavior (see thread)

tabs.1.mov

To Reproduce

  1. Dave a dashboard with “Tab A” and “Tab B”, both tabs have questions and common filters.
  2. Open “Tab A”, set some filter values and wait until things load
  3. Go to “Tab B”, wait until things load
  4. Go back to “Tab A”

Metabase reruns queries even though filters were not changed. This should not be happening as per this

Expected behavior

Shouldn't rerun the query if things keep unmodified

Logs

No response

Information about your Metabase installation

- V1.48.8

Severity

P2

Additional context

Happens in 48 and 47, doesn't happen in Master (49)

@ignacio-mb
Copy link
Contributor Author

Couldn't reproduce in 49, so closing this.

@cdeweyx cdeweyx added the .Team/DashViz Dashboard and Viz team label Mar 18, 2024
@kulyk kulyk self-assigned this Mar 29, 2024
@kulyk kulyk reopened this Mar 29, 2024
@kulyk
Copy link
Member

kulyk commented Mar 29, 2024

Update: the issue can be reproduced in 49 as well. #35465 fixed this on master but it wasn't backported to 49 (and most likely shouldn't)

@kulyk kulyk modified the milestones: 0.49, 0.49.3 Mar 29, 2024
@kulyk kulyk added Priority:P2 Average run of the mill bug support/Repro .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. labels Mar 29, 2024
@kulyk
Copy link
Member

kulyk commented Mar 30, 2024

Fixed in #40783

@kulyk kulyk closed this as completed Mar 30, 2024
@paoliniluis paoliniluis modified the milestones: 0.49.3, 0.48.10 Apr 3, 2024
@mayanala-coxauto
Copy link

It seems like if I have more than 8 Dashboard filters then it goes back to re-running the queries switching tabs.

@kulyk kulyk added .Reproduced Issues reproduced in test (usually Cypress) and removed support/Repro labels Apr 4, 2024
@kulyk
Copy link
Member

kulyk commented Apr 4, 2024

@mayanala-coxauto, after some investigation, I think the issue is related to pivot tables, and dashboard filters are not involved AFAICT. The pivot table issue is now tracked at #41043

@mayanala-coxauto
Copy link

@kulyk I'm not certain if it's just with pivot tables. I'm able to reproduce the issue with Sample DB.

Steps to Reproduce:

  1. Create Native Sql question with field filters and normal table visualization which default. Make created_at field as required field.
    SELECT
    "PUBLIC"."PEOPLE"."ID" AS "ID",
    "PUBLIC"."PEOPLE"."ADDRESS" AS "ADDRESS",
    "PUBLIC"."PEOPLE"."EMAIL" AS "EMAIL",
    "PUBLIC"."PEOPLE"."PASSWORD" AS "PASSWORD",
    "PUBLIC"."PEOPLE"."NAME" AS "NAME",
    "PUBLIC"."PEOPLE"."CITY" AS "CITY",
    "PUBLIC"."PEOPLE"."LONGITUDE" AS "LONGITUDE",
    "PUBLIC"."PEOPLE"."STATE" AS "STATE",
    "PUBLIC"."PEOPLE"."SOURCE" AS "SOURCE",
    "PUBLIC"."PEOPLE"."BIRTH_DATE" AS "BIRTH_DATE",
    "PUBLIC"."PEOPLE"."ZIP" AS "ZIP",
    "PUBLIC"."PEOPLE"."LATITUDE" AS "LATITUDE",
    "PUBLIC"."PEOPLE"."CREATED_AT" AS "CREATED_AT"
    FROM
    "PUBLIC"."PEOPLE"
    where true
    [[and {{v_id}}]]
    [[ and {{v_name}}]]
    [[ and {{v_city}}]]
    [[ and {{v_state}}]]
    [[ and {{v_source}}]]
    [[ and {{v_zip}}]]
    [[ and {{v_email}}]]
    [[ and {{v_password}}]]
    [[ and {{v_created_at}}]]
    LIMIT
    1048575

Native Sql Question with 9 filters looks as follows

  1. Create a Dashboard with 8 filters(in my case, I left the password field) and 2 tabs for same question created from step 1.

  2. Switch between tabs and notice messages from /var/log/messages. Since queries complete so fast, I had to look at /var/log/messages. In our environment, we check on Athena recent queries. Notice that re-run doesn’t happen.

  3. Add 9th filter, and repeat 3). Notice that re-run of the queries happen.

@mayanala-coxauto
Copy link

Question
image

Dashboard
image

@kulyk
Copy link
Member

kulyk commented Apr 4, 2024

Thank you for sharing such thorough repro steps, @mayanala-coxauto 🙏 I'll investigate

@JesseSDevaney JesseSDevaney changed the title Switching between tabs reruns queries even if filters keep unmodified Switching between tabs reruns queries even if filters are not modified Apr 19, 2024
@JesseSDevaney JesseSDevaney modified the milestones: 0.48.10, 0.49.8 Apr 23, 2024
@JesseSDevaney
Copy link
Contributor

The fix for more than 8 filters causing queries to be re-run has been merged here and will be added in 49.8:

@ignacio-mb
Copy link
Contributor Author

Just as a comment, queries are still being rerun when switching between tabs if the tab has a Pivot table

@mayanala-coxauto
Copy link

mayanala-coxauto commented May 21, 2024 via email

@ignacio-mb
Copy link
Contributor Author

Hi @mayanala-coxauto, for that I've opened a feature request here: #42956

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:P2 Average run of the mill bug .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Reporting/Dashboards .Reproduced Issues reproduced in test (usually Cypress) .Team/DashViz Dashboard and Viz team Type:Bug Product defects
Projects
None yet
Development

No branches or pull requests

6 participants