zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
3.67k stars 202 forks source link

BUG: File completely wiped out and unfix-able out after pressing CTRL + Z to undo a single change #1823

Closed winston142O closed 2 weeks ago

winston142O commented 3 weeks ago

Environment Settings

SYSTEM INFO:
    Obsidian version: v1.6.3
    Installer version: v1.6.3
    Operating system: #1 SMP PREEMPT_DYNAMIC Mon May 27 14:53:33 UTC 2024 6.8.11-300.fc40.x86_64
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Base theme: light
    Community theme: AnuPpuccin v1.5.0
    Snippets enabled: 5
    Restricted mode: off
    Plugins installed: 7
    Plugins enabled: 5
        1: Excalidraw v2.2.2
        2: Kanban v1.5.3
        3: Dataview v0.5.66
        4: Multi-Column Markdown v0.9.1
        5: MathLive v1.3.1

RECOMMENDATIONS:
    Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
    Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Describe the bug

This is the second time this happens. When inside a excalidraw, after mistakenly moving something or adding a element and quickly pressing CTRL + Z once to undo said change, the file completely wipes out, and deleting pretty much everything in the markdown and whatever wasn't deleted turns into compressed-json. This only happens inside .excalidraw files.

To Reproduce Steps to reproduce the behavior:

  1. Enter a excalidraw drawing.
  2. Perform an action (eg: moving something, adding an element)
  3. Press CTRL + Z once to undo the action
  4. See the file go blank before ultimately displaying a blank canvas

Expected behavior

The action to be undone and the file to go back to its previous state.

Screenshots

image

Additional context

This has happened twice, when a file was large but definitely not huge, for this one, I estimate around 10 pictures, no more than 500 words distributed across text boxes and some handwriting. When this happens, if you try to check the markdown, you can only see the following:

---

excalidraw-plugin: parsed
tags: [excalidraw]

---
==⚠  Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in pl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mCV

c0GSs5ESxCQJwAVWaABHABpHkoAARWaCcAHE336Z4AA0HgY6tgKWroQU+b5UWZUETSxfVkWhYN4Sew0EFu0p7uBXtcXxQkBlJclKWpWlWWqVYOCZUoIaKAbUE5VVtGGSURWaLkxQlKVER/OUhjWbQRlVAmWimHgyyTREDQhBB3TNFZvQ4X0wNQ+1HUrV1iHpz0ynIZm/TZ0kg2IOEmhjFG1h4Ym1hGIYFSpyGUzTaRuALEYUfGfptRFaZBVa7Ncw

GZpmilkZozhyBOZrOscmbRFW0/BALNQKy/q5gch2PUkxy5qdUlQud7chxdlwm39103bc6oRSH90PSzvcRU1zyNtAr3wG9qaiKAhHrCBEEWBZlCur5nbzCAeFwRMRWwHhGjWZpNElIaRgQEUywx033hGXAZcmfpq81ZpzZBZh3FKXJqjAP9p/6OZG3ywr/xKFZWxzTwqAamruCFbf6h6Dg+jQHl+kmSVz8b3rFmWQahhG3Z9jT1Apt6ivnFuIYODS

and it keeps going, but, even if it's possible to recover this compressed-json data (which I am not sure of), the text elements and embeds are completely gone, forever.

zsviczian commented 2 weeks ago

I am sorry this happened. I can see you are using Excalidraw 2.2.2. This issue was addressed in 2.2.3. See release notes here: https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/2.2.3

You did not share the complete markdown file. If you do I can check if I can restore it for you.

winston142O commented 2 weeks ago

Oops, I will make sure to update next time :( Thanks for all your work, thanks to you I don't need to use One Note anymore.

It would be really nice if the file can be restored, since I was using this specific file to study for a test I have this week. But if for any reason it cannot be, it's all good. Thank you so much for your offer.

Clase 6 2024-05-28 20.11.50.excalidraw.md

zsviczian commented 2 weeks ago

here you go:

Clase.6.2024-05-28.20.11.50.excalidraw.md

For anyone reading this in the future.

When elements are deleted, during the first save they are retained in the file with "isDeleted": true.

winston142O commented 2 weeks ago

Thank you so much!