rojo icon indicating copy to clipboard operation
rojo copied to clipboard

Plugin cannot undo rbxm sync if the root instance has changed type

Open Nolan-O opened this issue 9 months ago • 2 comments

Reproduction steps:

  • Save an instance to an rbxm in a syncable folder
  • Overwrite the rbxm with a different instance type
  • Ctrl-z

The synced instance is now gone, further undos will not bring any version of it back. The usage of undo implies that overwriting the rbxm was a mistake, making this a particularly destructive bug, it essentially makes it impossible to recover from the mistake unless you have a copy of the overwritten file on disc or a copy of the correct instances in studio.

Nolan-O avatar May 13 '24 20:05 Nolan-O

Rojo does set a history waypoint after making the change, but my guess is that somehow there's no waypoint prior to the change so it has nothing to go back to.

This type of issue has been solved with the new ChangeHistoryService APIs, TryBeginRecording and FinishRecording. These ensure that you have a start and end point for all changes.

Rojo should totally move to using the new history APIs. Thanks for bringing this up!

boatbomber avatar May 14 '24 02:05 boatbomber

Scratch that theory. It's because the original instance is Destroyed, and therefore ChangeHistoryService can do nothing to bring it back because Parent got locked.

boatbomber avatar May 14 '24 02:05 boatbomber