Skip to content

Code Mirror "Silent" Crash Recovery #5

@codeCraft-Ritik

Description

@codeCraft-Ritik

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions