Ver Fonte

HUE-9267 [editor] Add sanity check for delayed ddl execution

Johan Ahlen há 5 anos atrás
pai
commit
080fb745ca
1 ficheiros alterados com 5 adições e 1 exclusões
  1. 5 1
      desktop/core/src/desktop/js/apps/notebook/snippet.js

+ 5 - 1
desktop/core/src/desktop/js/apps/notebook/snippet.js

@@ -1036,8 +1036,12 @@ class Snippet {
     self.onDdlExecute = function() {
       if (self.result.handle() && self.result.handle().has_more_statements) {
         window.clearTimeout(self.executeNextTimeout);
+        const previousHash = self.result.handle().previous_statement_hash;
         self.executeNextTimeout = setTimeout(() => {
-          self.execute(true); // Execute next, need to wait as we disabled fast click
+          // Don't execute if the handle has changed during the timeout
+          if (previousHash === self.result.handle().previous_statement_hash) {
+            self.execute(true); // Execute next, need to wait as we disabled fast click
+          }
         }, 1000);
       }
       if (