Skip to content

[Bug]: Editor closes/deselects automatically after auto-save (Live Sync triggers full UI refresh) #752

Closed

Description

@MurlerDE

Describe the bug

After opening a snippet and typing, the editor automatically closes (deselects) a few seconds after the user stops typing. The snippet remains in the sidebar but must be manually re-selected to continue editing. The issue occurs regardless of whether the user is actively typing or not — the editor also closes without any input after a short idle period.

To reproduce

  1. Open any snippet
  2. Type a few characters
  3. Stop typing
  4. Wait ~2 seconds
  5. Editor closes — snippet is deselected in the UI

App Version and Architecture

latest (masscode-bin via AUR) OS: CachyOS (Arch-based), KDE Plasma, Wayland

System info

System:
    OS: Linux 7.0 CachyOS Linux
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13650HX
    Memory: 25.30 GB / 31.05 GB
    Container: Yes
    Shell: 4.6.0 - /bin/fish

Validations

Activity

  1. antonreshetov commented on Apr 25, 2026

    @antonreshetov
    Member

    The latest version is not the exact version, because it is the latest at the moment.

  2. github-actions commented on Apr 25, 2026

    @github-actions

    Hello @MurlerDE. Please describe in detail the sequence of actions that leads to the bug (skip it if it's already there). Add screenshots of errors from the console. If possible add a video. Issues marked with need reproduction will be closed if they have no activity within 3 days.

  3. MurlerDE commented on Apr 25, 2026

    @MurlerDE
    Author
    Image

    As long as I am actively typing, there are no problems.

    Image

    However, as soon as I stop typing, it takes about 2 or 3 seconds (likely when the auto-save triggers) and the snippet closes automatically.

    Image
  4. MurlerDE commented on Apr 25, 2026

    @MurlerDE
    Author

    The issue was reproduced on both masscode-bin v5.1.1 (AUR) and the official massCode-5.1.1.AppImage, ruling out a packaging issue. OS: CachyOS (Arch-based), KDE Plasma, Wayland.

  5. antonreshetov commented on Apr 27, 2026

    @antonreshetov
    Member

    One important thing from your screenshots: the app normally should not request the main snippets list as just /snippets/ in this view. It should include the current context, for example /snippets/?isInbox=1, /snippets/?folderId=6, /snippets/?isDeleted=0, etc.

    In your screenshot, after the deselection, the request appears to be just /snippets/. That suggests the renderer lost the current selection context (folderId, tagId, and libraryFilter) during the storage sync refresh.

    Could you please confirm this by clicking the last snippets/ request after the deselection and copying the full Request URL? Also please send the tree response from the same refresh.

  6. MurlerDE commented on May 1, 2026

    @MurlerDE
    Author
    2026-05-01.08-40-30.mp4

    this is a screen video of the issue. I will try out the current release version 5.2 and give feedback again.

  7. MurlerDE commented on May 1, 2026

    @MurlerDE
    Author

    I used AppImage 5.2.0. The error persists. I also have the console output; perhaps it will help.

    ~/Downloads
    ❯ ./massCode-5.2.0.AppImage

    API started on port 4321

    [5426:0501/084635.492181:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
    [5426:0501/084637.275999:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
    [5426:0501/084637.279716:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

    ~/Downloads 22s

  8. antonreshetov commented on May 2, 2026

    @antonreshetov
    Member

    The video doesn't show the open sidebar or which folder or library item you have selected.

  9. MurlerDE commented on May 6, 2026

    @MurlerDE
    Author

    I can no longer reproduce the error. The interface responds as expected, and the code snippets work as usual. However, there was also a major Linux update, which might have fixed the problem. (massCode-5.1.1.AppImage)

    The folder for storing the code snippets is the default folder created during installation: home/user/massCode.

    edit: I also installed masscode-bin, and that works without any problems now too.

  10. kenkotch-inspire commented on May 7, 2026

    @kenkotch-inspire

    I have the same issue using v5.4.0 on Mac OS 26.4.1 from the arm-64 image

    I've installed down to v5.0.0 and see the same behavior. (will keep going down when I have time)

    Update: The lastest working version for me on Mac is 4.7.1

  11. BryanWall commented on May 12, 2026

    @BryanWall

    On v5.4.0 on Macos, if I try making any changes to an existing snippet, after a few seconds the changes are automatically reverted but the editor doesn't close. The contents of the snippet just change back in the existing editor pane.

    If I create a new snippet, however, I am able to make changes to that snippet. Changes don't automatically revert. The new snippet can still be edited even if I move it to a different folder. I tried copying the content from an existing snippet, deleting it, and pasting the contents into a new snippet. The new version works and is editable.

    There are no differences in the yaml frontmatter between the working and non-working snippets. I couldn't see any difference in Macos file permissions or properties, either.

    I installed Masscode using the arm-64 image from the releases page on Github.

    Here's a video showing what is happening. A couple of seconds after I stop typing the changes disappear and it reverts back to the original content. It is impossible to make changes to snippets.


    Edit... I think the issue that I am experiencing may be caused by a previous version using ``` as the container for snippets: See #696. The snippets that are having this issue still contain the problematic ``` container which makes them impossible to edit in v5.4.0.

    If you copy the content, delete the snippet, and paste the content in a new snippet, it creates the snippet using the new container format and the snippet now works. I am not sure if this is related to the original issue reported above.

    Masscode-edit-issue.mov
  12. antonreshetov commented on May 13, 2026

    @antonreshetov
    Member

    @BryanWall
    This looks like a different issue. The original report is about the snippet being closed/deselected after autosave, while your case seems related to legacy snippet files using the old ``` fragment wrapper.

    Please open a separate issue with a minimal affected .md file.

  13. pchnl commented on Sep 13, 2026

    @pchnl

    Hi, I was evaluating massCode v5.11.0 today and this was the very first thing I encountered.
    When creating a new code snippet, i start typing the title and ... the cursor was gone. Clicked into the title area again and continued and again the cursor was stolen away (probably to update the list to the left of the snippet). This is on windows 10 pro.
    So if during typing a title you pause for 1 or 2 seconds, the cursor is taken away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions