The status is recorded in ClientDocInfo.Status and written to the DB via the UpdateClientInfoAfterPushPull method.
The status can be changed as follows
Attached <=> Detached
Attached => Removed
However, the following changes are not possible
Detached <=> Removed
Removed => Attached
We need to add check logic to return an error if it works incorrectly.
There is no check logic to prevent invalid changes to the ClientDocInfo.Status in UpdateClientInfoAfterPushPull.
What would you like to be added & Why is this needed:
The status of document changes as follow link(document-removal desing document) https://github.com/yorkie-team/yorkie/blob/main/design/document-removal.md#state-transition-of-document
The status is recorded in
ClientDocInfo.Status
and written to the DB via theUpdateClientInfoAfterPushPull
method.The status can be changed as follows
Attached
<=>Detached
Attached
=>Removed
However, the following changes are not possible
Detached
<=>Removed
Removed
=>Attached
We need to add check logic to return an error if it works incorrectly. There is no check logic to prevent invalid changes to the
ClientDocInfo.Status
inUpdateClientInfoAfterPushPull
.