aminghadersohi commented on code in PR #45612:
URL: https://github.com/apache/superset/pull/45612#discussion_r4350844713


##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:
##########
@@ -491,6 +542,11 @@ export default function DrillByModal({
   });
 
   useEffect(() => {
+    if (isTimeRangePending) {
+      setIsChartDataLoading(true);
+      setChartDataResult(undefined);
+      return;
+    }

Review Comment:
   Fixed in 54edda9c9f718f2fa6c8e83edab2f140fe45b428. Automatic loads and table 
reloads share one request lifecycle: superseding a request or unmounting aborts 
its HTTP/async wait, and late success, error, and completion callbacks cannot 
update the modal.
   
   Regression test: 'ignores stale initial success during bucket resolution' in 
`superset-frontend/src/components/Chart/DrillBy/DrillByModal.test.tsx`. The 
four explicitly named cases (initial/reload × success/error; declarations in 
004ac9220b07292057cbaf3e26d55656286071e0) fail with the pre-fix source and pass 
with this commit. They hold the next bucket range unresolved, settle the old 
request, assert loading stays visible and stale results stay absent, then 
verify the new bucket request completes normally. The broader Jest run passed 
139 tests across 8 suites; changed-file pre-commit passed.
   
   Siblings checked:
   - superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:463 — 
fixed in 54edda9c9f718f2fa6c8e83edab2f140fe45b428
   - superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:570 — 
fixed in 54edda9c9f718f2fa6c8e83edab2f140fe45b428
   - superset-frontend/src/components/Chart/DrillBy/useResultsTableView.tsx:34 
— not affected: table wrappers delegate to the shared reload callback, covered 
by the reload regression cases.
   - superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:377 — not 
affected: the range-resolution effect already invalidates its own late 
responses on cleanup.
   - 
superset-frontend/src/components/Chart/ChartContextMenu/ChartContextMenu.tsx:497
 — not affected: chart types open the same modal; this wrapper has no 
independent chart request.
   - superset-frontend/src/components/Chart/chartAction.ts:850 — not affected: 
Explore/dashboard chart loads already cancel superseded requests and guard 
stale results with their controller.
   - superset-frontend/src/features/versionHistory/ChartVersionPreview.tsx:179 
— not affected: preview loads already use a fetch-id guard and abort on cleanup.
   - 
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx:298
 — not affected: native-filter value queries do not use the pending 
drill-bucket lifecycle.
   - 
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx:587
 — not affected: filter-default queries do not use the pending drill-bucket 
lifecycle.
   - superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx:308 
— not affected: datasource-sample pagination does not resolve drill bucket 
ranges.
   - superset/mcp_service/chart/chart_helpers.py — not affected: server-side 
chart requests do not own or update the modal's React loading/result state.
   
   Searches: `rg -n 'requestChartDataResolved' superset-frontend --glob 
'*.{ts,tsx}'`; `rg -n 'DrillByModal|fetchDrillByTimeRange' 
superset-frontend/src superset-frontend/plugins --glob '*.{ts,tsx}'`.
   



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