Bug in Dato UI when duplicating a block in the Blocks Library

I just encountered a bug in the Dato UI that caused me to lose some data. I’ll describe the steps I took as best I can. I’m not comfortable attempting to reproduce the issue myself as it put my project in a bad state for a bit, so please forgive the vague report.

I have a custom block type A that’s enabled in two structured text fields. There are a couple dozen instances of this block type across a number of items. My goal was to add an additional custom block type B, which was to be similar to A, but with fewer fields.

Steps:

  1. I opened A in the blocks library and used the ā€˜Duplicate’ menu option to create the new block type B.
  2. I then deleted one of the fields that was not needed for B.
  3. Dato displayed a modal with a progress spinner that never completed even after waiting several minutes. There was no way to dismiss the modal.
  4. I refreshed the page, which showed that the field had been successfully removed.
  5. At this point I realized that I had deleted the field on the original block, A, instead of the new block B. I am unsure if this was an error on my part, or if the Dato UI was showing me the wrong type following the duplication action. Regardless, Dato should have warned me about the data loss that this caused on the instances of this block.
  6. I manually restored the field, moving the instances into an invalid state, and then manually re-populated the fields to get back into a good state.
  7. I then ensured I was viewing the new block type B before deleting the unneeded field. This time, Dato did warn me that data loss would occur, despite the page indicating that the block type was not used in any fields.
  8. At this point I became unsure if the Duplicate action had left the new type somehow linked in a way that I didn’t understand, so I opted to delete the new type entirely and manually create a new block type instead of starting from a duplicate.

It’d be great if a dev could check out this workflow and verify that the mistake described in step 5 was mine and not the system’s. In addition, it seems like Dato might have an issue with detecting when data loss could occur and displaying the proper warning, as well as a hanging loading indicator when the field was deleted.

Hello @bryan and welcome to the community!

At the moment, when you try to delete a field from a block, it shows up a modal as this one:

And if you don’t click ā€œYes, delete this fieldā€ the delete operation does not go through, so if this modal does not load, then the delete operation shouldn’t go through

The spinner can appear, but only after you already confirmed the deletion:

Let me know if you can reproduce the issue, so we can take a closer look on our end