ITADN

[Bug Report] Server-Side Data Inconsistencies When Rapidly Creating Nodes in ShareDB

#672ClosedTianBM 创建于 2024-07-22
T
TianBMcommented
## Bug Report ### Title Server-Side Data Inconsistencies When Rapidly Creating Nodes in ShareDB ### Description I'm using ShareDB and sharedb-mongo to build an online mind-map app. I found that when creating nodes in a short time, the server-side accepts operations (ops) with incorrect data. This issue is caused by the client-side pushing and applying ops with the same operation object. If the op-apply method changes the operation object, it will push to the server-side with incorrect data. Modifying the push op method could potentially resolve this issue. ### Steps to Reproduce Steps to reproduce the behavior: 1. Push an insert node operation. 2. Push an insert node operation in the last node's children. 3. Re-push the insert node operation as in step 2. 4. Observe the server-side operations and data. ### Expected Behavior The server-side should accept and apply operations with correct data, even when multiple nodes are created rapidly. ### Actual Behavior The client-side pushes the operation after it is applied, resulting in the operation being changed and causing incorrect data to be sent to the server-side. ### Screenshots ![Dingtalk_20240722102403](https://github.com/user-attachments/assets/d35634df-fa75-47b5-97f8-ff902ccbc4be) ### Environment - **ShareDB version**: 3.3.2 - **Node.js version**: 18 - **OTType**: [ot-tree](https://github.com/yiminghe/ot-tree) ### Additional Context This issue is affecting the reliability of real-time collaborative features in the application. Implementing a solution to handle rapid consecutive operations more effectively on the client-side would be highly beneficial. For example, ensuring unique operation objects for each push operation may resolve this issue.
关闭于 2024-07-29 12 条评论