dosubot[bot] commented on issue #38672: URL: https://github.com/apache/superset/issues/38672#issuecomment-4066411166
<!-- Greeting --> Hi @ferjanin! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> I investigated this and can confirm you've found a real bug. The root cause is clear: **The backend correctly adds `force=true` to dashboard URLs, but the frontend dashboard components don't read or use this parameter.** Here's the breakdown: **Why chart reports work:** The [Chart component in explore mode](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/components/Chart/Chart.tsx#L197-L206) actively reads the `force` parameter from the URL via `getUrlParam(URL_PARAMS.force)` and applies it to data requests. **Why dashboard reports fail:** The dashboard components ([DashboardBuilder](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx#L421), [extractUrlParams utility](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/util/extractUrlParams.ts#L21-L48)) don't extract or use the `force` URL parameter. They handle `standalone` correctly for report rendering, but simply ignore `force`. The backend side is working properly—[`_get_url()` in execute.py](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/commands/report/execute.py#L232-L237) adds `force=true` to dashboard URLs when `force_screenshot` is enabled. The gap is entirely on the frontend. **Fix approach:** The dashboard initialization code would need to: 1. Extract the `force` parameter from the URL (similar to how `standalone` is handled) 2. Pass it through to chart data requests during initial dashboard load The infrastructure already exists—[chartAction.js](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/components/Chart/chartAction.js#L157-L203) supports the `force` flag, it just isn't being set from the URL in dashboard context. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/400d88da-7252-4ed4-9a23-9635c93ba662?feedback_type=great_response&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/400d88da-7252-4ed4-9a23-9635c93ba662?feedback_type=irrelevant_answer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/400d88da-7252-4ed4-9a23-9635c93ba662?feedback_type=incorrect_sources&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/400d88da-7252-4ed4-9a23-9635c93ba662?feedback_type=too_verbose&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/400d88da-7252 -4ed4-9a23-9635c93ba662?feedback_type=hallucination&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/400d88da-7252-4ed4-9a23-9635c93ba662?feedback_type=bug_report&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report) | [Other](https://app.dosu.dev/response-feedback/400d88da-7252-4ed4-9a23-9635c93ba662?feedback_type=other&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge) [](https://cursor.com/link/prompt?text=I%20investigated%20this%20and%20can%20confirm%20you%27ve%20found%20a%20real%20bug.%20The%20root%20cause%20is%20clear%3A%0A%0A%2A%2AThe%20backend%20correctly%20adds%20%60force%3Dtrue%60%20to%20dashboard%20URLs%2C%20but%20the%20frontend%20dashboard%20components%20don%27t%20read%20or%20use%20this%20parameter.%2A%2A%0A%0AHere%27s%20the%20breakdown%3A%0A%0A%2A%2AWhy%20chart%20reports%20work%3A%2A%2A%20The%20%5BChart%20component%20in%20explore%20mode%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/components/Chart/Chart.tsx%23L197-L206%29%20actively%20reads%20the%20%60force%60%20parameter%20from%20the%20URL%20via%20%60 getUrlParam%28URL_PARAMS.force%29%60%20and%20applies%20it%20to%20data%20requests.%0A%0A%2A%2AWhy%20dashboard%20reports%20fail%3A%2A%2A%20The%20dashboard%20components%20%28%5BDashboardBuilder%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx%23L421%29%2C%20%5BextractUrlParams%20utility%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/util/extractUrlParams.ts%23L21-L48%29%29%20don%27t%20extract%20or%20use%20the%20%60force%60%20URL%20parameter.%20They%20handle%20%60standalone%60%20correctly%20for%20report%20rendering%2C%20but%20simply%20ignore%20%60force%60.%0A%0AThe%20backend%20side%20is%20working%20properly%E2%80%94%5B%60_get_url%28%29%60%20in%20execute.py%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/commands/report/execute.py%23L232-L237%29%20ad ds%20%60force%3Dtrue%60%20to%20dashboard%20URLs%20when%20%60force_screenshot%60%20is%20enabled.%20The%20gap%20is%20entirely%20on%20the%20frontend.%0A%0A%2A%2AFix%20approach%3A%2A%2A%20The%20dashboard%20initialization%20code%20would%20need%20to%3A%0A1.%20Extract%20the%20%60force%60%20parameter%20from%20the%20URL%20%28similar%20to%20how%20%60standalone%60%20is%20handled%29%0A2.%20Pass%20it%20through%20to%20chart%20data%20requests%20during%20initial%20dashboard%20load%0A%0AThe%20infrastructure%20already%20exists%E2%80%94%5BchartAction.js%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/components/Chart/chartAction.js%23L157-L203%29%20supports%20the%20%60force%60%20flag%2C%20it%20just%20isn%27t%20being%20set%20from%20the%20URL%20in%20dashboard%20context.) [](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment& utm_campaign=github-assistant&utm_content=join-discord) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/38672) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
