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

Filter changes does not update questions in Embed and Public #22524

Closed
superjcd opened this issue May 9, 2022 · 7 comments · Fixed by #22635
Closed

Filter changes does not update questions in Embed and Public #22524

superjcd opened this issue May 9, 2022 · 7 comments · Fixed by #22635
Assignees
Labels
Embedding/Public Simple public iframe embeds Embedding/Static Static embedding, previously known as signed embedding .Frontend Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness Querying/Parameters & Variables Filter widgets, field filters, variables etc. .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Reporting/Dashboards .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects
Milestone

Comments

@superjcd
Copy link

superjcd commented May 9, 2022

Describe the bug
Embeded iframe could not refresh when input changes。And interesting thing is if you copy the encoded(jwt thing) iframeUrl in any browser, the input does not worked, but when you refresh the url, and it will work properly again!

To Reproduce
1 share any dashborad with any filter by embeded url(the third way)
2 Use the suggested code(I used the python vesion) to encode the shared url
3 embed the encodes url in html files

Expected behavior
shoud refresh as soon as I type some values in the filters

Information about your Metabase Installation:
{
"browser-info": {
"language": "zh-CN",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "1.8.0_292-b10",
"java.vendor": "Red Hat, Inc.",
"java.vendor.url": "https://www.redhat.com/",
"java.version": "1.8.0_292",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "25.292-b10",
"os.name": "Linux",
"os.version": "3.10.0-1160.el7.x86_64",
"user.language": "zh",
"user.timezone": "Asia/Shanghai"
},
"metabase-info": {
"databases": [
"h2",
"clickhouse",
"mysql"
],
"hosting-env": "unknown",
"application-database": "mysql",
"application-database-details": {
"database": {
"name": "MySQL",
"version": "8.0.25"
},
"jdbc-driver": {
"name": "MariaDB Connector/J",
"version": "2.7.5"
}
},
"run-mode": "prod",
"version": {
"tag": "v0.43.0",
"date": "2022-05-02",
"branch": "release-x.43.x",
"hash": "ee686fc"
},
"settings": {
"report-timezone": "Asia/Shanghai"
}
}
}

Severity
its blocking some users

@superjcd superjcd added .Needs Triage Type:Bug Product defects labels May 9, 2022
@flamber
Copy link
Contributor

flamber commented May 9, 2022

Hi @superjcd
It seems like you are skipping steps-to-reproduce, or not fully describing the problem.
I cannot reproduce. Try reproducing with the Sample Database, and check your browser developer Network-tab to see requests and the Console-tab to see any errors.

@superjcd
Copy link
Author

superjcd commented May 9, 2022 via email

@superjcd
Copy link
Author

superjcd commented May 10, 2022

Steps to reproduce:

1 Create a question by a custom sql query (varialbles are both text type):

SELECT * FROM PEOPLE WHERE STATE={{state}} AND CITY={{city}}

2 Create a dashborad, and add the question we made before, which shall give you a result like(Filters are both Text and category type, and dropdown style, link to the proper varible we've created before):
image

3 Pusblish it with both varible editable.

4 Using the iframeUrl-generating code as the site suggests(I used the python version)to generate a iframeUrl.

import jwt
import time

METABASE_SITE_URL = "your ip address"
METABASE_SECRET_KEY = "you token"

payload = {
  "resource": {"dashboard": your dashborad id},
  "params": {"state":"AL"},
  "exp": round(time.time()) + (60 * 10) # 10 minute expiration
}
token = jwt.encode(payload, METABASE_SECRET_KEY, algorithm="HS256")

iframeUrl = METABASE_SITE_URL + "/embed/dashboard/" + token + "#bordered=true&titled=true"

5 Copy the iframeUrl to the browser, you can see the result like below:
image
It didn't work at all
6 Bizarre thing is refreshing the url will make it work again!
image

Some web browser logs may help

settings.js:110 Error getting setting table.columns TypeError: Cannot read properties of undefined (reading 'cols')
    at Object.getDefault (Table.jsx:182:11)
    at bt (settings.js:101:39)
    at vt (settings.js:42:5)
    at b (visualization.js:77:10)
    at o.value (Visualization.jsx:150:9)
    at o.value (Visualization.jsx:81:10)
    at Lo (react-dom.production.min.js:137:128)
    at Ba (react-dom.production.min.js:176:159)
    at xs (react-dom.production.min.js:263:490)
    at yl (react-dom.production.min.js:246:265)

@flamber
Copy link
Contributor

flamber commented May 10, 2022

@superjcd I cannot reproduce with the steps you include. Create a video showing everything you are doing from the beginning.

@flamber
Copy link
Contributor

flamber commented May 10, 2022

@karlrapley Okay, I cannot reproduce, so please provide a video, since there's steps missing.
And include "Diagnostic Info" from Admin > Troubleshooting.

@superjcd
Copy link
Author

superjcd commented May 11, 2022

@flamber
Here is the video:

bugReport.mp4

Diagnostic Info

{
"browser-info": {
"language": "zh-CN",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "GBK",
"java.runtime.name": "Java(TM) SE Runtime Environment",
"java.runtime.version": "17.0.2+8-LTS-86",
"java.vendor": "Oracle Corporation",
"java.vendor.url": "https://java.oracle.com/",
"java.version": "17.0.2",
"java.vm.name": "Java HotSpot(TM) 64-Bit Server VM",
"java.vm.version": "17.0.2+8-LTS-86",
"os.name": "Windows 10",
"os.version": "10.0",
"user.language": "zh",
"user.timezone": "Asia/Shanghai"
},
"metabase-info": {
"databases": [
"h2"
],
"hosting-env": "unknown",
"application-database": "h2",
"application-database-details": {
"database": {
"name": "H2",
"version": "1.4.197 (2018-03-18)"
},
"jdbc-driver": {
"name": "H2 JDBC Driver",
"version": "1.4.197 (2018-03-18)"
}
},
"run-mode": "prod",
"version": {
"date": "2022-05-02",
"tag": "v0.43.0",
"branch": "release-x.43.x",
"hash": "ee686fc"
},
"settings": {
"report-timezone": null
}
}
}

@flamber flamber added Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness Reporting/Dashboards Querying/Parameters & Variables Filter widgets, field filters, variables etc. .Frontend Embedding/Public Simple public iframe embeds Embedding/Static Static embedding, previously known as signed embedding .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. and removed .Needs Triage labels May 11, 2022
@flamber flamber added this to the 0.43.1 milestone May 11, 2022
@flamber
Copy link
Contributor

flamber commented May 11, 2022

Regression since 0.43.0 - worked on 0.43.0-rc2

Happens in both Embedding and Public, but only for dashboards.

I'm not quite sure what is going on, since I'm seeing errors on a FE component, which isn't related

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'type')
    at j (utils.js:89:11)
    at actions.js:579:11
    at u (runtime.js:63:40)
    at Generator._invoke (runtime.js:293:22)
    at Generator.next (runtime.js:118:21)
    at M (Toggle.tsx:41:17)
    at a (Toggle.tsx:41:17)
    at Toggle.tsx:41:17
    at new Promise (<anonymous>)
    at Toggle.tsx:41:17

But the frontend is not sending a request to the backend, which is why it is working when you are doing a browser refresh.

@alxnddr alxnddr self-assigned this May 11, 2022
@alxnddr alxnddr added the .Reproduced Issues reproduced in test (usually Cypress) label May 11, 2022
@flamber flamber changed the title Embeded iframe could not refresh when input changes Filter changes does not update questions in Embed and Public May 13, 2022
This was referenced Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Embedding/Public Simple public iframe embeds Embedding/Static Static embedding, previously known as signed embedding .Frontend Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness Querying/Parameters & Variables Filter widgets, field filters, variables etc. .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Reporting/Dashboards .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants