Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add Reusable Block deletion #4139
An edge case, but one that could be potentially destructive: We allow the user to delete a reusable block while it's still in its "temporary" unsaved state, meaning that it will use the value produced by
uniqueId. Since a block could exist with an ID matching the temporary ID, the user could inadvertently delete the wrong reusable block.
Luckily I didn't have a block with ID 2:
- Prevent deleting reusable block if it hasn't been saved yet.
- Maybe pass the argument to
uniqueId, which acts as a prefix. Arguably this shouldn't be necessary, but eliminates any chance that the temproary ID overlaps with a real block ID.
Question: Should the deleted block be removed from
state.preferences.blockUsage as well? I've noticed there's some issues with Reusable Blocks in recent and frequently used blocks, so wasn't sure if you planned to address this separately. I'd guess that the reusable block of
state.preferences.blockUsage is not storing the
ref anyways, so not tracking details of the block being removed.