Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hackerwins opened this issue Jul 8, 2024 · 6 comments
Closed
Assignees
Labels
bug 🐞 Something isn't working

Comments

@hackerwins
Copy link
Member

hackerwins commented Jul 8, 2024

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:

  • Operating system:
  • Browser and version:
  • CodePair version:
@hackerwins hackerwins added the bug 🐞 Something isn't working label Jul 8, 2024
@devleejb devleejb moved this to Backlog in Yorkie Project Jul 12, 2024
@devleejb devleejb moved this to Backlog in CodePair Jul 31, 2024
@wet6123
Copy link
Contributor

wet6123 commented Aug 10, 2024

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

@devleejb
Copy link
Member

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

@devleejb devleejb moved this from Backlog to In progress in Yorkie Project Aug 11, 2024
@devleejb devleejb modified the milestones: v0.1.1, v0.1.2 Aug 12, 2024
@devleejb devleejb moved this from Backlog to In progress in CodePair Aug 12, 2024
@devleejb devleejb modified the milestones: v0.1.2, v0.1.3, v0.1.4 Aug 14, 2024
@devleejb
Copy link
Member

@wet6123 Could you share the progress?

@devleejb devleejb modified the milestones: v0.1.4, v0.1.5, v0.1.6, v0.1.7 Aug 24, 2024
@wet6123
Copy link
Contributor

wet6123 commented Aug 25, 2024

@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!

@devleejb devleejb removed this from the v0.1.7 milestone Aug 30, 2024
@wet6123
Copy link
Contributor

wet6123 commented Sep 7, 2024

@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.

@devleejb
Copy link
Member

In development mode, it runs in StrictMode. So, because of debugging purpose, the useEffect runs twice in developement mode.

Reference: https://sentry.io/answers/react-useeffect-running-twice/Reference: https://sentry.io/answers/react-useeffect-running-twice/

@github-project-automation github-project-automation bot moved this from In progress to Done in CodePair Nov 21, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Yorkie Project Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
Status: Done
Status: Done
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants