excalidraw / excalidraw-vscode

Excalidraw for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=pomdtr.excalidraw-editor
MIT License
430 stars 50 forks source link

File has changes immediately after opening the file #129

Open fultonm opened 3 months ago

fultonm commented 3 months ago

After opening an excalidraw file in VsCode, the file always has changes even if the file has not really been touched yet.

Short screen recording demonstrating the behavior: https://1drv.ms/v/s!AiSCz54h8oiP2DWiRl2ThvtWDyzw?e=G9KR5u

I believe this issue starts to occur when objects are grouped. Without grouping, the file doesn't have changes immediately after opening.

This makes it difficult to know which files have actually been modified, and also creates some anxiety about clicking save/discard changes. Since I am not sure if the file has been ghost-modified from this bug or if the file really had changes.

To figure out what changes there were, I initialized a git repository, and found the version, versionNonce, and updated fields were all modified.

So a potential fix could have the extension wait until the file has been modified by the user before changing these fields.

fultonm commented 3 months ago

Is this a known issue?

Can others reproduce?

Enzo-PVsyst commented 2 months ago

Hello,

I have the same thing happening on my end.

I just created an folder with some .excalidraw files, and when opening them in VScode they appear with changes.

Is there any workaround ?

fultonm commented 2 months ago

I think I noticed Excalidraw for web also does this. So this may be an upstream issue.

can anyone confirm?

asinyagin commented 3 weeks ago

I have the same behavior. Excalidraw changes fields version, versionNonce, updated of each element. It's hard to read diff of files because of these changes.