bito-code-review[bot] commented on PR #43330:
URL: https://github.com/apache/superset/pull/43330#issuecomment-5340467805

   <!-- Bito Reply -->
   The flagged issue is correct: the current implementation only checks if the 
`latestQuery` state is 'success', but it does not invalidate this state when 
the user modifies the SQL in the editor. This allows saving a dataset based on 
stale results from a previous query.
   
   To resolve this, you should track whether the SQL in the editor matches the 
SQL of the successful query. A concise way to implement this is to compare the 
current editor SQL with the SQL of the `latestQuery` whenever the editor 
content changes, and only enable the save button if they match and the state is 
'success'.
   
   Would you like me to fetch all other comments on this PR to validate and 
implement fixes for them as well?
   
   **superset-frontend/src/SqlLab/components/SqlEditor/index.tsx**
   ```
   const canSaveDataset = latestQuery?.state === 'success' && latestQuery?.sql 
=== queryEditor.sql;
   ```


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