Implement validation check for operations on the server side
Opened this issue · 2 comments
What would you like to be added:
Currently, we only perform validation checks for operations during local updates. We apply the operation to a clone during doc.update()
, and if the operation is invalid, we handle the failure. Since validation checks are performed locally, no such checks are performed when an operation is saved on the server, and propagated to remote clients.
However, there have been cases where invalid operations passed through the SDK, resulting in continuous sync-failed
errors upon receiving them on the remote side and leading to duplicate application of remote-change
.
![](https://private-user-images.githubusercontent.com/81357083/329495124-2ceaa933-dbd8-4cd5-b975-80d3552302be.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ2ODY0NTYsIm5iZiI6MTcyNDY4NjE1NiwicGF0aCI6Ii84MTM1NzA4My8zMjk0OTUxMjQtMmNlYWE5MzMtZGJkOC00Y2Q1LWI5NzUtODBkMzU1MjMwMmJlLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI2VDE1MjkxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ0M2JlOGEzY2I2NGFmNjgwMTQ5NjgyYzhjNjM1YTg0Y2YxNzFlM2Y3ZTlkYjhjMmVmMjg3OWE5N2ZmNzdjZTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.8A4ASK8XHL1kZY7ICal3MJ7tfReyfr6RVtRyCyiexK0)
Therefore, there is a need to implement checks to ensure that invalid changes do not propagate in the SDK development process. During the execution of PushPullChange
on the server, we can validate the changes and fail the request if they are invalid.
Why is this needed:
To prevent the propagation of invalid changes and ensure data integrity.
Related: #805
Thanks for your opinion.
To validate the operations on the server, it is necessary to load the document into memory, which poses a risk of degrading the overall performance of PushPullChanges. Therefore, it would be good to create --inspection
flag to validate the document's integrity only under specific runs($ yorkie server --inspection
).
Hello!
Can I try this issue?