villebro commented on code in PR #43473:
URL: https://github.com/apache/superset/pull/43473#discussion_r3846017429


##########
superset-frontend/src/components/Chart/chartAction.ts:
##########
@@ -767,9 +769,20 @@ export function exploreJSON(
           response,
           json,
           () =>
-            requestChartData(true).then(({ response: r, json: j }) =>
-              handleChartDataResponse(r, j),
-            ) as Promise<QueryData[]>,
+            requestChartData(true).then(({ response: r, json: j }) => {

Review Comment:
   Fixed in e63a05f2bd. The post-completion re-issue now runs **synchronously** 
(`enableAsyncMode: false`), so it never schedules a second background task — it 
reads the warm per-query cache, or computes inline once if the result wasn't 
cached. The repeat-202 branch (and its duplicate-task path) is gone entirely.
   
   Added a regression test asserting the re-issue carries no `async_mode` in 
its body and that exactly two requests are made (async submit + one sync 
re-issue, no third call).



##########
superset-frontend/src/components/Chart/chartAction.ts:
##########
@@ -767,9 +769,20 @@ export function exploreJSON(
           response,
           json,
           () =>
-            requestChartData(true).then(({ response: r, json: j }) =>
-              handleChartDataResponse(r, j),
-            ) as Promise<QueryData[]>,
+            requestChartData(true).then(({ response: r, json: j }) => {
+              // Tasks succeeded, but if the result was never cached the
+              // re-request returns another 202 (NullCache is refused 
server-side,
+              // yet an oversized result or a per-query disabled timeout still
+              // skips the write). Fall back to a synchronous fetch, which 
returns
+              // the payload inline, instead of looping on an uncacheable 
request.
+              if (r.status === 202) {
+                return requestChartData(true, true).then(

Review Comment:
   Fixed in e63a05f2bd. The re-issue now uses the caller's original `force` (no 
longer forced to `false`), so a forced refresh bypasses any stale cached entry 
instead of returning it. Combined with the sync change above, the 
post-completion request is a single synchronous call that preserves `force` — 
reading the warm cache on a normal request, or recomputing fresh when the user 
forced a refresh.
   
   The regression test drives a `force: true` request and asserts the 
re-issue's URL carries `force=true`.



-- 
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]

Reply via email to