WIP: Losing Redos after a lot of Undos

Browser: Chrome Version 137.0.7151.69 (Official Build) (64-bit)
OS: Windows 11

I am working on a page and adding sections in the structure tree where there is already a full page of a lot of divs. Doing a lot of operations.

I do Ctrl+Z a lot and then the undo stops, the undo arrow is deactivate and the redo button is deactivated.

I can’t redo anything. I do have revisions.

I have done this 2 times now, but it’s not exactly repeatable other than just do a lot of operations and at a point where I have done many, try to undo all the way back and it will lose redos.

Once I restore a revision, there are no undos and redos.

I can most likely reproduce this in a video, but I can’t really say what steps to take to reproduce it.

This happens in v1.12.4 & v2.0-beta.

Here is a video of after I had done a lot of operations and lost redos. I restored a revision and got a couple of undos and then it stopped and I could do redos. I did several redos and you can see right after this:

Uncaught TypeError: Cannot read properties of undefined (reading 'color')
E
@
(main.min.js:88:141305)
e.value
@
(main.min.js:88:135047)
e.value
@
(main.min.js:88:134616)
e.value
@
(main.min.js:88:168013)
e.value
@
(main.min.js:88:168157)
Ze
@
(main.min.js:88:186602)
(anonymous)
@
(main.min.js:111:221652)
Object.goto
@
(main.min.js:111:221512)
HTMLDocument.<anonymous>

I lost redos and undos.

Jam Video: Jam

Hi @macksix,

thank you for the video. Huh, this will be hard to duplicate, so, steps to replicate would be:

  1. Work on some layout, and use revisions.
  2. Once you apply a revision, and work on it, use undo/redo
  3. The error occurs.

Does the error always happen at the exact same action (change of background colour for example), or it’s random?

Matej

I don’t think it is necessary to use a revision, but it orginally occured with an imported layout I pasted to a new page.

In the video below, it happened on “Uncaught TypeError: Cannot read properties of undefined (reading ‘font-weight’)”

See video: Jam

I am still working on this. :slight_smile:

Uncaught TypeError: Cannot read properties of undefined (reading ‘top’)

See video: Jam

I am getting closer to a step by step reproduction of it.

1 Like

Here we go.

Paste this to a new page in Bricks v2.0-beta.

Follow the steps in this video:

https://jam.dev/c/3142a580-4cc3-41b6-96dd-b5f65c752c9d

In the last Undo/Redo routine in the video, the Redo stops working and there is no Undo/Redo any longer.

The error is thrown:

Uncaught TypeError: Cannot read properties of undefined (reading ‘top’)

Hi @macksix,

I have to say, this took a lot of time for you to figure out how to replicate it and for me to actually replicate all the steps :smiley: The issue I replicated was not the same, but the result is the same, so I guess fixing one will fix the other one as well.

Also, not only we loose the undo/redo actions, but the structure does not look the same, right? I’ll create an internal task for this, but I have to find an easier way to replicate this.

Thank you for really checking into this.
Matej

It stops in the middle of a Redo or Undo and leaves the structure in an intermediate state. If it leaves it in a bogus intermediate state, I didn’t notice that.

Yeah, I think it’s also visible on your video. If yo check here (Jam), and then just wait for a few seconds, when error appears, you will see that the structure is very, very different.

I don’t think this is an intermediate state. :thinking:

Matej

1 Like