scratchfoundation / scratch-desktop

Scratch 3.0 as a self-contained desktop application
BSD 3-Clause "New" or "Revised" License
355 stars 236 forks source link

Previous project costumes (including photos) still accessible after starting new project #105

Open SteveDoesStuff opened 4 years ago

SteveDoesStuff commented 4 years ago

Expected Behavior

After starting a new project in the app (File > New) the Undo button in the costumes tab would be disabled as there should be no previous state.

Actual Behavior

After starting a new project, the Undo button in the costumes tab is active and pressing it loads the last active costume from the previous project.

This is a potential privacy issue for my work, since this could load a photo of the previous user if that was their last active costume. We teach children and adults about coding in different locations each day, so could potentially have 5 year olds taking photos in Scratch one day, and those photos be accessed by adults the next day.

Currently the only way to prevent this from happening is to fully quit the app and launch it again. Since it seems to not be clearing information with a new project as expected, I believe it may be related to another low priority issue I reported #56 as well as the issue of project names not resetting #71

Steps to Reproduce

  1. Add a costume to your sprite
  2. Start a new project by clicking File > New
  3. Navigate to the costumes tab and before making any changes click the Undo button, which loads the costume from your previous project

Operating System and Browser

Mac OS 10.15.3 - Scratch Desktop 3.6.0 (from App Store)

apple502j commented 4 years ago

Should be moved to LLK/scratch-paint

apple502j commented 4 years ago

The only time the cache is fully cleared is when the costume is switched via the costume pane, so this can be reproduced by a couple of ways: 1) Loading a new project somehow (New or Importing), and clicking Undo 2) Go to Code tab, select other sprite and switch to Costume then clicking Undo

The question is, when should it be cleared? On Scratch 2.0, the undo state is stored per-costume, so this would not happen. It may be possible to do so, but not sure if it's still the good thing.