When sync and detach functions are called simultaneously, local changes are being pushed to the server multiple times.
Although server has logic to filter out already pushed changes, this logic doesn't work properly during the detach process.
During DetachDocument on the server side, the clientSeq and serverSeq of clientDocInfo are reset to 0 before pushing the changes, causing duplicate changes to be pushed.
What you expected to happen:
Local changes should only be pushed to the server once, even if sync and detach are called simultaneously.
How to reproduce it (as minimally and precisely as possible):
You can test this behavior by running the following test code in the js-sdk:
What happened:
When
sync
anddetach
functions are called simultaneously, local changes are being pushed to the server multiple times. Although server has logic to filter out already pushed changes, this logic doesn't work properly during the detach process.During
DetachDocument
on the server side, theclientSeq
andserverSeq
ofclientDocInfo
are reset to 0 before pushing the changes, causing duplicate changes to be pushed.What you expected to happen:
Local changes should only be pushed to the server once, even if
sync
anddetach
are called simultaneously.How to reproduce it (as minimally and precisely as possible):
You can test this behavior by running the following test code in the js-sdk:
Anything else we need to know?:
Environment:
yorkie version
):