Просмотр исходного кода

Don't throw an error if we get an ack for our update more than once, since we may try sending it more than once

James Allen 10 лет назад
Родитель
Сommit
4bc31ae2b9

+ 7 - 0
services/web/public/coffee/ide/editor/sharejs/vendor/client/doc.coffee

@@ -192,6 +192,13 @@ class Doc
         callback error for callback in @inflightCallbacks
       else
         # The op applied successfully.
+        
+        # We may get multiple acks of the same message if we retried it, 
+        # so its ok if we receive an ack for a version that we've already gone past.
+        # If so, just ignore it
+        if msg.v < @version
+            return
+
         throw new Error('Invalid version from server') unless msg.v == @version
 
         @serverOps[@version] = oldInflightOp