Преглед изворни кода

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

Johan Ahlen пре 5 година
родитељ
комит
080fb745ca
1 измењених фајлова са 5 додато и 1 уклоњено
  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 (