codeant-ai-for-open-source[bot] commented on code in PR #45928:
URL: https://github.com/apache/superset/pull/45928#discussion_r4439442351


##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/keyValue.tsx:
##########
@@ -66,22 +66,41 @@ export const createFilterKey = (
       return null;
     });
 
-export const getFilterValue = (dashId: string | number, key?: string | null) =>
+// Single attempt with no client-side retries, so an aborted request settles
+// immediately. Callers that need retries own them.
+const getOnce = (endpoint: string, signal?: AbortSignal) =>
   SupersetClient.get({
-    endpoint: assembleEndpoint(dashId, key),
-  })
+    endpoint,
+    signal,
+    fetchRetryOptions: { retries: 0 },

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `ed38d26`.
   
   `getPermalinkValue` now uses the regular `SupersetClient.get` call rather 
than `getOnce`, which sets `fetchRetryOptions: { retries: 0 }`.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



##########
superset-frontend/src/dashboard/containers/DashboardPage.tsx:
##########
@@ -353,9 +433,42 @@ export const DashboardPage: FC<PageProps> = ({ idOrSlug }: 
PageProps) => {
       }
       return null;
     }
-    if (id) getDataMaskApplied();
+    if (id && readyToRender) getDataMaskApplied();
+    return () => {
+      cancelled = true;
+      controller.abort();
+      retryController.current?.abort();
+    };
     // eslint-disable-next-line react-hooks/exhaustive-deps
-  }, [readyToRender]);
+  }, [readyToRender, id]);
+
+  const retrySharedState = useCallback(async () => {
+    const source = sharedStateSource.current;
+    if (!source) return;
+    retryController.current?.abort();
+    const controller = new AbortController();
+    retryController.current = controller;
+    setIsRetryingSharedState(true);
+    const result: SharedStateResult<unknown> = await fetchSharedState(
+      source,
+      controller.signal,
+    );
+    if (controller.signal.aborted) return;
+    setIsRetryingSharedState(false);
+    if (result.status !== 'ok') {
+      setSharedStateNotice(result.status === 'expired' ? 'expired' : 'failed');
+      return;
+    }
+    const mask =
+      source.kind === 'permalink'
+        ? (result.value as DashboardPermalinkValue)?.state?.dataMask
+        : (result.value as Record<string, DataMask> | null);

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `ed38d26`.
   
   On retry success, the code passes `toSharedState(source, result.value)` to 
`hydrateWithStateRef`, applying the full shared state before clearing the 
notice.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



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

  • [PR] fix(da... eschutho (via GitHub) via notifications
    • Re: [P... codecov[bot] (via GitHub) via notifications
    • Re: [P... netlify[bot] (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... dpgaspar (via GitHub) via notifications
    • Re: [P... fitzee (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... msyavuz (via GitHub) via notifications

Reply via email to