yorkie-js-sdk icon indicating copy to clipboard operation
yorkie-js-sdk copied to clipboard

Error `document not attached` occurs when Detach and Sync race

Open chacha912 opened this issue 1 year ago • 3 comments

What happened:

Error document not attached occurs when going backwards in codepair. This error occurs due to a race condition between Detach and Sync requests. Since a sync loop is performed independently of a detach, the client may send a sync request while the document is still considered attached before receiving a response to the detach request. This causes an error on the server because it has already processed the detach request and considers the document detached.

image

What you expected to happen:

The Detach and Sync requests should not race to avoid the document not attached error.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Operating system:
  • Browser and version:
  • Yorkie version (use yorkie version):
  • Yorkie JS SDK version:

chacha912 avatar Jul 03 '24 02:07 chacha912

I'm interested in this issue. Can I give it a shot?

jeonghye-choi avatar Jul 19 '24 13:07 jeonghye-choi

Sure :)

blurfx avatar Jul 19 '24 13:07 blurfx

@jeonghye-choi I've unassigned you from this issue to allow others to contribute. If you're still interested in it, please let me know.

sejongk avatar Sep 20 '24 16:09 sejongk

@gwbaik9717 Hi. Are you still working on this issue yourself? If not, we'd like to unassign so that other contributors can work on it.

blurfx avatar Jul 12 '25 04:07 blurfx

Oh sure! Ive been busy working on other stuff.. Feel free to do so :)

gwbaik9717 avatar Jul 12 '25 07:07 gwbaik9717

I'm interested in this issue, but is it still unresolved? I'm trying to reproduce the problem, but it's not easy. While I was typing in the document to reproduce the push-pull situation in a deactivated state, I hit the back button and noticed that instead of a "document not attached" error, I got a "client not activated" error. If this is an unresolved issue, could you tell me how to reproduce it?

Image

ezcolin2 avatar Aug 15 '25 05:08 ezcolin2