Collaborative Editing

Does the UI send the full sfdt when collaborative editing is turned on? 


7 Replies

DS Dhanush Sekar Syncfusion Team January 17, 2025 12:32 PM UTC

Hi Christian,


When you edit a document in collaborative mode, the document editor does not send the entire Sfdt. It only transmits the data related to the specific edit actions.


Please feel free to reach out if you require any further assistance.


Regards,

Dhanush Sekar



DS Dhanush Sekar Syncfusion Team January 17, 2025 12:32 PM UTC

Hi Christian,


When you edit a document in collaborative mode, the document editor does not send the entire Sfdt. It only transmits the data related to the specific edit actions.


Please feel free to reach out if you require any further assistance.


Regards,

Dhanush Sekar



MA Mamatha January 17, 2025 04:28 PM UTC

Hi Dhanush,

This is the follow-up with Christian's query

We are using SyncFusion Document for collaborative editing.
I followed your code implemented on the server side for ASP .NET, where once the threshold is reached a document is being created.

  •  How is it getting the full sfdt to save in the document?
  • Also if it transmits the data related to specific edits everytime, how are we saving the complete data into the document? (Ex: if userA types "H" and userB types "i", then how are we transcripting the word "Hi"(complete word or sentence) on the word document.
  • How does the server side know the formattings applied over a particular word/sentence if the data is not received in the sfdt format.


KM Kavitha Muralitharan Syncfusion Team January 20, 2025 11:23 AM UTC

Christian, 

In collaborative editing, each specific action is transmitted to the server whenever it is performed. On the server side, we have implemented an auto-save feature. There is a threshold(reference) on the server side that determines when to save these operations to the document. Once this threshold is reached, the operations are removed from the cache and saved to the original document(reference). This describes the workflow of collaborative editing in the document editor. Please refer the below documentation for more details on Collaborative editing.

Documentation - https://ej2.syncfusion.com/aspnetcore/documentation/document-editor/collaborative-editing/using-redis-cache-asp-net




MA Mamatha January 31, 2025 02:03 PM UTC

Hi Team,

These are some more queries we had wrt to collaborative editing

  1. How are you handling the conflicts wrt to versions while multiple users are editing the document
  2. Also how are you overwriting the existing document on reaching the threshold(I mean what happens to the data that is already present on the document prior to the collab editing)?.
  3. Initially the file was not creating
    Error in this line
    Stream stream1 = System.IO.File.Open(currentDirectory + "\\" + fileName, FileMode.Open, FileAccess.ReadWrite);

    then I made changes in FileMode 
    Stream stream1 = System.IO.File.Open(currentDirectory + "\\" + fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite);

    Then the file was getting created but the in next line its not loading and throws a exception as mentioned 

  4. We are getting this error while running your sample Server side code for ASP.Net core using PostGres
    Image_5421_1738331935321

    in the line   Syncfusion.EJ2.DocumentEditor.WordDocument document = Syncfusion.EJ2.DocumentEditor.WordDocument.Load(stream1, GetFormatType(type));
  5. With continuation to the point.2- 
    I can see the document that loads newly is the document with room name as the new file. 
    Can you please provide more info on where and how the source document is being picked in this case for applying the new changes.
    Ex: as per the code the file that loads initially is GaintPanda.docx within the wwwroot folder
    but on reaching the threshold the document is picked from the outer folder
  6. Can you please provide more info on the transformation logic/algorithm and how it is working

Thanks


DS Dhanush Sekar Syncfusion Team February 4, 2025 02:35 PM UTC

Hi Mamatha,


  1. How are you handling the conflicts wrt to versions while multiple users are editing the document

 

The Document Editor employs an operational transformation algorithm to resolve conflicts during collaborative editing. For additional information on collaborative editing, please consult the documentation provided below.

Documentation - https://ej2.syncfusion.com/documentation/document-editor/collaborative-editing/overview

 

  1. Also how are you overwriting the existing document on reaching the threshold(I mean what happens to the data that is already present on the document prior to the collab editing)?.

 

Regarding 'overwriting the existing document':

 

The changes made in the session is applied to the source document once the threshold is reached.

  1. Initially the file was not creating
    Error in this line
    Stream stream1 = System.IO.File.Open(currentDirectory + "\\" + fileName, FileMode.Open, FileAccess.ReadWrite);

    then I made changes in FileMode 
    Stream stream1 = System.IO.File.Open(currentDirectory + "\\" + fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite);

    Then the file was getting created but the in next line its not loading and throws a exception as mentioned 

  2. We are getting this error while running your sample Server side code for ASP.Net core using PostGres
    Image_5421_1738331935321

    in the line   Syncfusion.EJ2.DocumentEditor.WordDocument document = Syncfusion.EJ2.DocumentEditor.WordDocument.Load(stream1, GetFormatType(type));

 

Based on the error provided, we believe the problem may be due to an invalid DOCX file.

We recommend using a valid DOCX file.

Please try using a valid DOCX file and inform us if you continue to encounter any issues with loading the file.

  1. With continuation to the point.2- 
    I can see the document that loads newly is the document with room name as the new file. 
    Can you please provide more info on where and how the source document is being picked in this case for applying the new changes.
    Ex: as per the code the file that loads initially is GaintPanda.docx within the wwwroot folder
    but on reaching the threshold the document is picked from the outer folder

 

Every document is assigned a unique room name, which identifies the specific document being edited by users. In our example, we have utilized a 'Getting Started' document. The document is fetched from the wwwroot directory on initial load using the GetSourceDocument API. Once a certain threshold is reached, we use the unique identifier to retrieve the document and apply the necessary changes, fetching the document from the wwwroot directory in our sample.

In your application, it is necessary to maintain a unique identifier for each document. This unique identifier allows you to retrieve the document for opening and saving in the Document Editor.

 

  1. Can you please provide more info on the transformation logic/algorithm and how it is working

 

The Document Editor employs an operational transformation algorithm to resolve conflicts during collaborative editing. For additional information on collaborative editing, please consult the documentation provided below.

Documentation - https://ej2.syncfusion.com/documentation/document-editor/collaborative-editing/overview

 




Regards,

Dhanush S



DS Dhanush Sekar Syncfusion Team February 4, 2025 02:35 PM UTC

Hi Mamatha,


  1. How are you handling the conflicts wrt to versions while multiple users are editing the document

 

The Document Editor employs an operational transformation algorithm to resolve conflicts during collaborative editing. For additional information on collaborative editing, please consult the documentation provided below.

Documentation - https://ej2.syncfusion.com/documentation/document-editor/collaborative-editing/overview

 

  1. Also how are you overwriting the existing document on reaching the threshold(I mean what happens to the data that is already present on the document prior to the collab editing)?.

 

Regarding 'overwriting the existing document':

 

The changes made in the session is applied to the source document once the threshold is reached.

  1. Initially the file was not creating
    Error in this line
    Stream stream1 = System.IO.File.Open(currentDirectory + "\\" + fileName, FileMode.Open, FileAccess.ReadWrite);

    then I made changes in FileMode 
    Stream stream1 = System.IO.File.Open(currentDirectory + "\\" + fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite);

    Then the file was getting created but the in next line its not loading and throws a exception as mentioned 

  2. We are getting this error while running your sample Server side code for ASP.Net core using PostGres
    Image_5421_1738331935321

    in the line   Syncfusion.EJ2.DocumentEditor.WordDocument document = Syncfusion.EJ2.DocumentEditor.WordDocument.Load(stream1, GetFormatType(type));

 

Based on the error provided, we believe the problem may be due to an invalid DOCX file.

We recommend using a valid DOCX file.

Please try using a valid DOCX file and inform us if you continue to encounter any issues with loading the file.

  1. With continuation to the point.2- 
    I can see the document that loads newly is the document with room name as the new file. 
    Can you please provide more info on where and how the source document is being picked in this case for applying the new changes.
    Ex: as per the code the file that loads initially is GaintPanda.docx within the wwwroot folder
    but on reaching the threshold the document is picked from the outer folder

 

Every document is assigned a unique room name, which identifies the specific document being edited by users. In our example, we have utilized a 'Getting Started' document. The document is fetched from the wwwroot directory on initial load using the GetSourceDocument API. Once a certain threshold is reached, we use the unique identifier to retrieve the document and apply the necessary changes, fetching the document from the wwwroot directory in our sample.

In your application, it is necessary to maintain a unique identifier for each document. This unique identifier allows you to retrieve the document for opening and saving in the Document Editor.

 

  1. Can you please provide more info on the transformation logic/algorithm and how it is working

 

The Document Editor employs an operational transformation algorithm to resolve conflicts during collaborative editing. For additional information on collaborative editing, please consult the documentation provided below.

Documentation - https://ej2.syncfusion.com/documentation/document-editor/collaborative-editing/overview

 




Regards,

Dhanush S


Loader.
Up arrow icon