-
-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Summary:
The editor currently uses a "Hard Error" state when it detects a sync failure between the Y.js document and the CodeMirror view. This forces a full browser refresh, which clears the session's chat history and UI state.
Description:
In PyIDE.jsx, the health check interval (line 133) monitors if yCollab has stopped syncing. If a mismatch is detected, setEditorCrashed(true) is triggered, replacing the entire editor UI with a refresh prompt. This is disruptive for collaborative sessions.
How to Fix:
Modify PyIDE.jsx State: Instead of a boolean editorCrashed, use a state that allows for a "re-syncing" status.
Implement handleSoftReset: Create a function that:
Temporarily nullifies the editorViewRef.current.
Re-runs the logic to initialize theyCollabextension with the existing ytextRef.current and awarenessRef.current.
Update UI: Replace the "Refresh Page" button with a "Repair Connection" button that calls the soft reset function.