yorkie-team / codepair

Build your own AI-powered collaborative markdown editor in just 5 minutes
https://codepair.yorkie.dev
Apache License 2.0
46 stars 19 forks source link

yorkie.Document initialized twice when entering document editing page #228

Open hackerwins opened 2 months ago

hackerwins commented 2 months ago

What happened:

Under specific circumstances, when entering the document editing page, yorkie.Document is initialized twice. Initially, when accessing the document editing page from the document list, yorkie.Client and yorkie.Document are initialized once. However, upon returning to the document list and revisiting the document page, yorkie.Document is initialized twice.

screen-capture.webm

This behavior seems to increase the frequency of race condition between Client.Sync and Client.Detach.

Related to

What you expected to happen:

yorkie.Document should only be initialized once when entering the document editing page.

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

  1. Access the document list.
  2. Enter the document editing page.
  3. Return to the document list.
  4. Re-access the document editing page.
  5. Notice that yorkie.Document is initialized twice.

Anything else we need to know?:

Environment:

wet6123 commented 1 month ago

I'm interested in it. Can i try it?

devleejb commented 1 month ago

@wet6123 Sure! I'll assign you. Please share the reason and discuss here!

devleejb commented 3 weeks ago

@wet6123 Could you share the progress?

wet6123 commented 3 weeks ago

@devleejb oh I was so busy finishing my school project, so I couldn't work on it. I'll wrap it up by this week!

wet6123 commented 1 week ago

@hackerwins I'm trying to reproduce this bug, but I'm unable to reproduce it. Could you please check again, and if the bug is still there, please tell me more about your reproduction.