File tree Expand file tree Collapse file tree 1 file changed +7
-17
lines changed
packages/loro-adaptors/src/server Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -38,24 +38,14 @@ export class LoroServerAdaptor implements CrdtServerAdaptor {
3838 let updates : Uint8Array [ ] | undefined ;
3939
4040 if ( clientVersion . length > 0 ) {
41- try {
42- const clientVV = VersionVector . decode ( clientVersion ) ;
43- const comparison = serverVersion . compare ( clientVV ) ;
44-
45- if ( comparison && comparison > 0 ) {
46- const updateData = doc . export ( {
47- mode : "update" ,
48- from : clientVV ,
49- } ) ;
50- updates = [ updateData ] ;
51- }
52- } catch {
53- const snapshot = doc . export ( { mode : "snapshot" } ) ;
54- updates = [ snapshot ] ;
55- }
41+ const clientVV = VersionVector . decode ( clientVersion ) ;
42+ const updateData = doc . export ( {
43+ mode : "update" ,
44+ from : clientVV ,
45+ } ) ;
46+ updates = [ updateData ] ;
5647 } else {
57- const snapshot = doc . export ( { mode : "snapshot" } ) ;
58- updates = [ snapshot ] ;
48+ updates = [ documentData ] ;
5949 }
6050
6151 const response : JoinResponseOk = {
You can’t perform that action at this time.
0 commit comments