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

Error occurs when clicking back button in the document - "document not attached" #146

Open devleejb opened 7 months ago

devleejb commented 7 months ago

What happened: When clicking the back button in the document, an error message stating "document not attached" is displayed.

What you expected to happen: Clicking the back button should navigate to the previous page without any error message.

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

  1. Open the document.
  2. Perform some actions within the document.
  3. Click the back button.

Anything else we need to know?: The error message occurs consistently whenever the back button is clicked.

Environment:

rappire commented 1 month ago

Title

Fix issue with continuous PushPullChanges requests after detaching document

Content

What this PR does / why we need it?

This PR addresses a bug where continuous PushPullChanges requests are sent even after detaching a document, causing errors in the process. The issue occurs when navigating back triggers the document detach process.

In the yorkie-js-sdk, when editing a document, PushPullChanges requests are sent at specified intervals. However, the problem arises when detaching a document in the sdk. Despite the detach operation, the loop responsible for sending PushPullChanges requests is not terminated. As a result, the yorkie server receives requests for a detached document, leading to errors.

에러 에러2

Once an error occurs, the loop is terminated, preventing further issues from arising.

Any background context you want to provide?

In the yorkie-js-sdk, detaching a document should ideally stop the process of sending PushPullChanges requests, ensuring that only relevant and active documents trigger these requests. before sending request change DocumentStatus detached.

What are the relevant tickets?

Checklist

rappire commented 1 month ago

I found a bug and want to fix it, but I couldn't because it's an issue with the yorkie-js-sdk

devleejb commented 1 month ago

Related to https://github.com/yorkie-team/codepair/issues/220

devleejb commented 1 month ago

@hackerwins May I ask for your opinion?

hackerwins commented 1 month ago

I found a bug and want to fix it, but I couldn't because it's an issue with the yorkie-js-sdk

It looks like this will have to be resolved in the JS SDK. and we are working on https://github.com/yorkie-team/yorkie-js-sdk/issues/856.

@jeonghye-choi @rappire Could we work together?

rappire commented 1 month ago

I want to try to solve this problem, but jeonghye-choi is already in charge, can I work on it?