sadpandajoe commented on code in PR #44851:
URL: https://github.com/apache/superset/pull/44851#discussion_r4189812973


##########
superset-frontend/src/features/semanticViews/SemanticViewEditModal.tsx:
##########
@@ -188,15 +203,87 @@ export default function SemanticViewEditModal({
       });
       addSuccessToast?.(t('Semantic view updated'));
       onSave();
-      onHide();
+      if (isCurrent()) handleHide();
     } catch (error) {
       const clientError = await getClientErrorObject(error);
       addDangerToast?.(
         clientError.error ||
           t('An error occurred while saving the semantic view'),
       );
     } finally {
-      setSaving(false);
+      if (isCurrent()) {
+        busy.current = false;
+        setSaving(false);
+      }
+    }
+  };
+
+  const reloadFields = async (
+    viewId: number,
+    changed: boolean,
+    isCurrent: () => boolean,
+  ) => {
+    setSyncState({ status: 'reloading', changed });
+    try {
+      const { json } = await SupersetClient.get({
+        endpoint: `/api/v1/semantic_view/${viewId}/structure`,
+      });
+      if (!isCurrent()) return;
+      setStructure(json.result);
+      await onMetadataSync?.(isCurrent);

Review Comment:
   If this callback rejects after the structure GET succeeds, this `await` is 
what prevents a false sync-success state; the modal tests only fail the 
preceding GET. Could a regression reject `onMetadataSync` and assert “Reload 
fields” plus a retry without another refresh POST?



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