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

Leading zero in filter value in embedded dashboard breaks it #41483

Closed
vvaezian opened this issue Apr 16, 2024 · 1 comment · Fixed by #41545
Closed

Leading zero in filter value in embedded dashboard breaks it #41483

vvaezian opened this issue Apr 16, 2024 · 1 comment · Fixed by #41545
Assignees
Labels
Embedding/ Use this label when unsure which flavor of embedding is impacted Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness .Team/Embedding Type:Bug Product defects
Milestone

Comments

@vvaezian
Copy link

vvaezian commented Apr 16, 2024

Describe the bug

Setting filter value to something like "0001" doesn't work anymore.
Console log says Uncaught SyntaxError: Unexpected number in JSON

To Reproduce

  • Create a dashboard and add a question
  • Add a filter to dashboard and tie to the question
  • Enable embedding for the dashboard
  • Generate the embedding link and open it
  • Set the value of the filter to "01" and load the page again. It breaks.

Expected behavior

No response

Logs

JS Console Log: SyntaxError: Unexpected number in JSON at position 1 (line 1 column 2)
MB Server logs: No Error

Information about your Metabase installation

Metabase Version: 0.49.6 (upgraded from 47, so not sure at which version this issue started)

Severity

Breaks the affected embedded dashboards

Additional context

It's common for ID columns to start with zero. And they are used in embedding for filtering data.

@vvaezian vvaezian added .Needs Triage Type:Bug Product defects labels Apr 16, 2024
@npretto npretto added Embedding/ Use this label when unsure which flavor of embedding is impacted .Team/Embedding Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness and removed .Needs Triage labels Apr 16, 2024
@npretto
Copy link
Member

npretto commented Apr 16, 2024

Seems like 2ffee75 is the first broken commit on the release branch for 49.
Before that, the url gets updated and ?id=01 becomes ?id=1.
If you open the iframe url it works, i think it's something related to isWithinIframe, possibly

store.dispatch(setOptions(window.location));

@deniskaber deniskaber self-assigned this Apr 17, 2024
@deniskaber deniskaber added this to the 0.49.7 milestone Apr 18, 2024
This was referenced May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Embedding/ Use this label when unsure which flavor of embedding is impacted Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness .Team/Embedding Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants