codeant-ai-for-open-source[bot] commented on code in PR #43429:
URL: https://github.com/apache/superset/pull/43429#discussion_r3836959319
##########
superset-frontend/src/components/Chart/chartAction.ts:
##########
@@ -441,11 +448,22 @@ const v1ChartDataRequest = async (
allowDomainSharding,
}).toString();
+ // Opt full JSON chart-data renders into async execution per the resolved
policy
+ // (feature flag + deployment default + optional per-dashboard override). The
+ // server treats an absent async_mode as synchronous, so this is additive.
+ const asyncMode =
+ resultFormat === 'json' &&
+ resultType === 'full' &&
+ resolveAsyncMode(requestParams.async_mode_override);
+ const body = JSON.stringify(
+ asyncMode ? { ...payload, async_mode: true } : payload,
+ );
Review Comment:
**Suggestion:** Applying `resolveAsyncMode` inside the shared
`v1ChartDataRequest` opts every default JSON/full caller into asynchronous
execution when the feature flag and deployment default are enabled. Callers
such as `AlertReportModal` call `getChartDataRequest` directly and then
immediately read `response.json.result` without handling HTTP 202 task
responses, so they receive `{task_ids}` and fail instead of receiving chart
data. Restrict this opt-in to callers that implement the async polling path, or
update every affected caller to await the async response. [api mismatch]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Alert dashboard-filter values fail when async execution is enabled.
- ❌ Direct chart-data consumers receive task IDs instead of query results.
- ⚠️ Only deployments with async queries and uncached requests are affected.
```
</details>
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/components/Chart/chartAction.ts
**Line:** 454:460
**Comment:**
*Api Mismatch: Applying `resolveAsyncMode` inside the shared
`v1ChartDataRequest` opts every default JSON/full caller into asynchronous
execution when the feature flag and deployment default are enabled. Callers
such as `AlertReportModal` call `getChartDataRequest` directly and then
immediately read `response.json.result` without handling HTTP 202 task
responses, so they receive `{task_ids}` and fail instead of receiving chart
data. Restrict this opt-in to callers that implement the async polling path, or
update every affected caller to await the async response.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43429&comment_hash=9ff82e00131e5e3d7ce9e69deb462cf98722ddefadf15cefe32d84716c9de912&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43429&comment_hash=9ff82e00131e5e3d7ce9e69deb462cf98722ddefadf15cefe32d84716c9de912&reaction=dislike'>👎</a>
--
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]