Skip to content

Lag + quickly switching sprites => new lists/variables appear #309

@nimeratus

Description

@nimeratus

The bug also happens with lists instead of variables

Expected Behavior

Switching sprites doesn't make variables that aren't used by the code in the sprite

Actual Behavior

New variables are created in the third sprite for each variable in the second sprite - even if a variable with the same name already exists in that sprite! (this can be seen by downloading the sprite and looking at the JSON)

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to 'https://scratch.mit.edu/projects/1210441091/'
    Note: the third sprite doesn't have a b variable but the second sprite does
  2. Select the first sprite
  3. Turn on the lag (eg. by starting the project, but putting thousands of blocks into the second sprite also works because it makes lag when switching to the second sprite)
  4. Quickly switch to the second and the third sprite
    Note: the variables from the second sprite are now in the third sprite, but they don't show up in the block palette yet
  5. Turn off the lag (optional)
  6. Switch to the costumes tab and back
    => now the b variable appears in the third sprite.
  7. Download the sprite and extract the sprite.json
  8. See that it has two definitions (with different IDs) for the a variable

System Details

I've tried it out on Windows 10, Chrome 139

keywords: duplicated / duplicating variables, ghost variables

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions