File tree Expand file tree Collapse file tree 3 files changed +10
-12
lines changed
packages/loro-websocket/src Expand file tree Collapse file tree 3 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -534,7 +534,7 @@ export class LoroWebsocketClient {
534534 active . handler . handleDocUpdate ( msg . updates ) ;
535535 } else {
536536 const pending = this . pendingRooms . get ( roomId ) ;
537- if ( pending && pending . adaptor . crdtType === CrdtType . Elo ) {
537+ if ( pending ) {
538538 const buf = this . preJoinUpdates . get ( roomId ) ?? [ ] ;
539539 buf . push ( ...msg . updates ) ;
540540 this . preJoinUpdates . set ( roomId , buf ) ;
@@ -651,7 +651,7 @@ export class LoroWebsocketClient {
651651 active . handler . handleDocUpdate ( [ reassembledData ] ) ;
652652 } else {
653653 const pending = this . pendingRooms . get ( id ) ;
654- if ( pending && pending . adaptor . crdtType === CrdtType . Elo ) {
654+ if ( pending ) {
655655 const buf = this . preJoinUpdates . get ( id ) ?? [ ] ;
656656 buf . push ( reassembledData ) ;
657657 this . preJoinUpdates . set ( id , buf ) ;
@@ -672,7 +672,7 @@ export class LoroWebsocketClient {
672672 this . roomAdaptors . set ( id , adaptor ) ;
673673 this . roomIds . set ( id , roomId ) ;
674674
675- // Flush buffered %ELO updates if any
675+ // Flush buffered updates if any
676676 const buf = this . preJoinUpdates . get ( id ) ;
677677 if ( buf && buf . length ) {
678678 try {
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ const defaultDescriptors: ServerAdaptorDescriptor[] = [
2727 {
2828 adaptor : new LoroServerAdaptor ( ) ,
2929 shouldPersist : true ,
30- allowBackfillWhenNoOtherClients : false ,
30+ allowBackfillWhenNoOtherClients : true ,
3131 } ,
3232 {
3333 adaptor : new LoroEphemeralServerAdaptor ( ) ,
Original file line number Diff line number Diff line change @@ -330,14 +330,12 @@ export class SimpleServer {
330330 joinResult . updates . length ;
331331
332332 if ( shouldBackfill && joinResult . updates ) {
333- for ( const u of joinResult . updates ) {
334- this . sendMessage ( client . ws , {
335- type : MessageType . DocUpdate ,
336- crdt : message . crdt ,
337- roomId : message . roomId ,
338- updates : [ u ] ,
339- } ) ;
340- }
333+ this . sendMessage ( client . ws , {
334+ type : MessageType . DocUpdate ,
335+ crdt : message . crdt ,
336+ roomId : message . roomId ,
337+ updates : joinResult . updates
338+ } ) ;
341339 }
342340 } catch ( error ) {
343341 this . sendJoinError (
You can’t perform that action at this time.
0 commit comments