EnxDev commented on code in PR #42241:
URL: https://github.com/apache/superset/pull/42241#discussion_r3622335017


##########
superset-frontend/src/SqlLab/actions/sqlLab.ts:
##########
@@ -1514,6 +1514,11 @@ export function persistEditorHeight(
   };
 }
 
+function handlePopError(dispatch: AppDispatch, errorMessage: string) {
+  dispatch(addDangerToast(errorMessage));
+  dispatch(addNewQueryEditor());
+}
+

Review Comment:
   handlePopError always dispatches `addNewQueryEditor()`, which mutates the 
tab state and clears the permalink (or other URL params) from the address bar. 
   On a transient error (for example, a 500 or network issue), the user loses 
the original link and can't simply refresh to retry.
   
   Could we decouple exiting the loading state from mutating the tab state? 
   
   For example, let `PopEditorTab` clear the loading state in a finally block 
and only call `addNewQueryEditor()` when there are no query editors left.



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