Skip to content

Clear out the blocks in dispose. Fixes #1758 where old monitored vari… #1818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

picklesrus
Copy link
Contributor

@picklesrus picklesrus commented Dec 5, 2018

…ables were getting kept across project loads

Resolves

Fixes #1758

Proposed Changes

The original approach of clearing out all of monitor blocks didn't work (see the note below) because we recycle stage monitor blocks.

This way only deletes sprite specific monitors and global variables but leaves stage monitors (like backdrop number) alone.

Test Coverage

Added integration test and verified that it fails without the change to dispose.

…ld monitored variables were getting kept across project loads
… loaded so was hand editing the monitorBlocks before loading the default project. The code I added to dispose was then clearing that out.
kchadha
kchadha previously requested changes Dec 6, 2018
Copy link
Contributor

@kchadha kchadha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm it looks like there's something weird going on with the monitor blocks that have a menu.

You can observe via:

  1. Create a monitor for backdrop number
  2. Create a monitor for backdrop name; observe that the backdrop name monitor appears empty
  3. Change the selected option in the menu of the costume block in the toolbox; observe that the backdrop name monitor got filled in

It's not immediately clear what's going on here, but I think we should investigate and then decide what to do about it.

@kchadha kchadha removed their assignment Dec 6, 2018
…ting all of the monitor blocks for each sprite and the global variables.
@picklesrus
Copy link
Contributor Author

Fixed @kchadha's bug (great fine!). Since we ended up working together and tried multiple approaches, looking for a new set of eyes on this PR.

Copy link
Contributor

@paulkaplan paulkaplan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meeps, needing to tip-toe around certain recycled blocks makes me scared. But if it works!

We might want to file an "ergonomics" issue for clarifying what "dispose" means for the runtime, since it is becoming pretty specialized. It doesn't, for instance, stop the stepping loop for threads, which may or may not be an oversight...

@kchadha
Copy link
Contributor

kchadha commented Dec 7, 2018

@paulkaplan, that sounds like a good idea. Yeah, runtime dispose becoming suddenly populated with a lot of different things is definitely worrisome and something to keep an eye on. This was a great example of us not realizing that we're making assumptions in other places that certain things (e.g. stage monitor blocks in the monitor block container) are going to stick around and things break if they are cleared out. It would be good to track these kinds of things in ergonomics or tech debt issues.

@picklesrus
Copy link
Contributor Author

Filed #1829 and labeled it both tech debt and ergonomics. If there are other dispose-y things that show up soon, please pile them on.

@picklesrus picklesrus dismissed kchadha’s stale review December 7, 2018 20:07

Because we resolved stuff but somehow github doesn't think so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants