tldraw / tldraw-v1

A tiny little drawing app. This is the original 2021-2022 version, released under MIT.
https://old.tldraw.com
MIT License
64 stars 35 forks source link

[bug] Alt + click copying an image/video shape and undoing causes crash #290

Closed milo- closed 2 years ago

milo- commented 2 years ago

To Reproduce:

  1. Add an image shape
  2. Alt + Click to Copy a few times
  3. Undo a couple of times

Similar to https://github.com/tldraw/tldraw-v1/issues/297 this also throws and exception in the useShapeTree as the shape type property is missing. This only seems to be an issue with local undo/redo, it doesn't impact Liveblocks multiplayer undo/redo.

I'm wondering if there needs to be a filter here as a fallback in case any unknown shapes / shapes missing a type are found to prevent these crashes.

Demo: https://www.loom.com/share/59b3f36c324e45ec9c5012b6ef775c98

steveruizok commented 2 years ago

Is this just an issue with the ImageShape? No other shapes are producing the same bug?

milo- commented 2 years ago

ImageShape and VideoShape, I've not been able to reproduce with any of the other shapes.