Skip to content

Excalidraw file modified by MetaEdit while drawing causes loss of data #50

@zsviczian

Description

@zsviczian

Please see this issue raised by @zhl111 for Excalidraw #296.

@zhl111 singled out MetaEdit as the root cause of the data loss by way of elimination... i.e. turning off plugins one-by-one until only MetaEdit was left.

I haven't done detailed testing, however, my assumptions are the following:

  • It seems that while editing an Excalidraw drawing somehow MetaEdit is triggered. This could be linked to Excalidraw autosave.
  • When MetaEdit is triggered, it probably modifies the excalidraw.md file, which in turn is interpreted by Excalidraw as a trigger to reload the drawing. Note, that I monitor background file changes to allow use-cases such as editing the same file side by side in markdown mode and in drawing mode, as well as to handle file sync events, such as when using Obsidian sync.

I recommend adding the following logic to onFileModify() (and potentially other relevant functions) avoid this issue:
if (app.workspace.activeLeaf.view.getViewType()==="excalidraw") return;

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