Parcourir la source

Fix bug that was causing clients to disconnect

Eric Zhang il y a 4 ans
Parent
commit
7b00ffdd85
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/rustpad.ts

+ 1 - 1
src/rustpad.ts

@@ -97,13 +97,13 @@ class Rustpad {
       }
       for (let i = this.revision - start; i < operations.length; i++) {
         let { id, operation } = operations[i];
+        this.revision++;
         if (id === this.me) {
           this.serverAck();
         } else {
           operation = OpSeq.from_str(JSON.stringify(operation));
           this.applyServer(operation);
         }
-        this.revision++;
       }
     }
   }