@@ -5,16 +5,14 @@ use crate::{errors::FlowyError, DocumentEditor, DocumentUser};
55use bytes:: Bytes ;
66use flowy_database:: ConnectionPool ;
77use flowy_error:: { internal_error, FlowyResult } ;
8+ use flowy_http_model:: document:: DocumentPayloadPB ;
9+ use flowy_http_model:: revision:: Revision ;
10+ use flowy_http_model:: ws_data:: ServerRevisionWSData ;
811use flowy_revision:: {
912 RevisionCloudService , RevisionManager , RevisionMergeable , RevisionObjectDeserializer , RevisionObjectSerializer ,
1013 RevisionWebSocket ,
1114} ;
12- use flowy_sync:: entities:: ws_data:: ServerRevisionWSData ;
13- use flowy_sync:: {
14- entities:: { document:: DocumentPayloadPB , revision:: Revision } ,
15- errors:: CollaborateResult ,
16- util:: make_operations_from_revisions,
17- } ;
15+ use flowy_sync:: { errors:: CollaborateResult , util:: make_operations_from_revisions} ;
1816use lib_infra:: future:: FutureResult ;
1917use lib_ot:: core:: { AttributeEntry , AttributeHashMap } ;
2018use lib_ot:: {
@@ -47,7 +45,7 @@ impl DeltaDocumentEditor {
4745 let document = rev_manager
4846 . initialize :: < DeltaDocumentRevisionSerde > ( Some ( cloud_service) )
4947 . await ?;
50- let operations = DeltaTextOperations :: from_bytes ( & document. content ) ?;
48+ let operations = DeltaTextOperations :: from_bytes ( & document. data ) ?;
5149 let rev_manager = Arc :: new ( rev_manager) ;
5250 let doc_id = doc_id. to_string ( ) ;
5351 let user_id = user. user_id ( ) ?;
@@ -255,7 +253,7 @@ impl RevisionObjectDeserializer for DeltaDocumentRevisionSerde {
255253
256254 Result :: < DocumentPayloadPB , FlowyError > :: Ok ( DocumentPayloadPB {
257255 doc_id : object_id. to_owned ( ) ,
258- content : delta. json_str ( ) ,
256+ data : delta. json_bytes ( ) . to_vec ( ) ,
259257 rev_id,
260258 base_rev_id,
261259 } )
0 commit comments