You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by di...@apache.org on 2022/08/22 18:00:19 UTC
[superset] 15/19: Fix endless re-requests on request failure.
This is an automated email from the ASF dual-hosted git repository.
diegopucci pushed a commit to branch chore/e2e-tests-drilltodetail-modal
in repository https://gitbox.apache.org/repos/asf/superset.git
commit bd21c5ea2e38d0391e1e1952cf7406c1c9c2601d
Author: Cody Leff <co...@preset.io>
AuthorDate: Tue Aug 16 21:39:54 2022 -0700
Fix endless re-requests on request failure.
---
.../src/dashboard/components/DrillDetailPane/DrillDetailPane.tsx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/superset-frontend/src/dashboard/components/DrillDetailPane/DrillDetailPane.tsx b/superset-frontend/src/dashboard/components/DrillDetailPane/DrillDetailPane.tsx
index 0682ae671b..c697ff7f29 100644
--- a/superset-frontend/src/dashboard/components/DrillDetailPane/DrillDetailPane.tsx
+++ b/superset-frontend/src/dashboard/components/DrillDetailPane/DrillDetailPane.tsx
@@ -116,12 +116,14 @@ export default function DrillDetailPane({
// Clear cache on reload button click
const handleReload = useCallback(() => {
+ setResponseError('');
setResultsPages(new Map());
setPageIndex(0);
}, []);
// Clear cache and reset page index if filters change
useEffect(() => {
+ setResponseError('');
setResultsPages(new Map());
setPageIndex(0);
}, [filters]);
@@ -145,7 +147,7 @@ export default function DrillDetailPane({
// Download page of results & trim cache if page not in cache
useEffect(() => {
- if (!isLoading && !resultsPages.has(pageIndex)) {
+ if (!responseError && !isLoading && !resultsPages.has(pageIndex)) {
setIsLoading(true);
const jsonPayload = getDrillPayload(formData, filters);
const cachePageLimit = Math.ceil(SAMPLES_ROW_LIMIT / PAGE_SIZE);
@@ -189,6 +191,7 @@ export default function DrillDetailPane({
formData,
isLoading,
pageIndex,
+ responseError,
resultsPages,
]);