File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ export class SocketIOProvider extends Observable {
157157
158158    this . doc . on ( 'update' ,  this . onUpdateDoc ) 
159159
160-     this . socket . on ( 'connect ',  ( )  =>  this . onSocketConnection ( resyncInterval ) ) 
160+     this . socket . once ( 'ready-for-sync ',  ( )  =>  this . onSocketConnection ( resyncInterval ) ) 
161161
162162    this . socket . on ( 'disconnect' ,  ( event )  =>  this . onSocketDisconnection ( event ) ) 
163163
Original file line number Diff line number Diff line change @@ -171,6 +171,7 @@ export class YSocketIO {
171171        this . client . getDoc ( namespace ,  'index' ) . then ( ( doc )  =>  { 
172172          assert ( socket . user ) 
173173          assert ( this . subscriber ) 
174+           socket . emit ( 'ready-for-sync' ) 
174175          if  ( 
175176            api . isSmallerRedisId ( doc . redisLastId ,  socket . user . initialRedisSubId ) 
176177          )  { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments