Skip to content
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

Switching projects does not clear workspace state - Marlowe blocks editor #70

Open
1 of 2 tasks
BeksOmega opened this issue Mar 24, 2021 · 0 comments
Open
1 of 2 tasks
Assignees

Comments

@BeksOmega
Copy link
Contributor

Diagnostic info:

  • I was using the:
    • Plutus Playground
    • Marlowe Playground
  • Link to gist with saved setup that reproduces the issue: N/A

Description

When you switch projects you expect that nothing should be "left over" from the previous project, but this is not the case. For example the trashcan still contains deleted blocks from the previous project:
trashcan-leaking

And the blockly undo stack still has actions from the previous project. See how I can use undo to get the blocks from the first project into the second:
events-leaking

This may not seem bad now, but in the future if you want to restrict blocks so that they are only available under certain circumstances, this could cause you major problems.

Steps to reproduce

  1. Open up a project on the marlowe playground.
  2. Delete some blocks.
  3. Open the trashcan and observe how the deleted blocks are available.
  4. Open a new project.
  5. Open the trashcan and observe how the deleted blocks are still available, even though they should not be.
  6. Press undo continually until you get back to the state of the previous project. Observe how this should not be possible.

Suggested solution

The simplest thing to do is just dispose of the old workspace and re-inject it whenever you switch projects. This makes sure that all event listeners, collections, and other state get cleaned up properly. Plus it's pretty simple.

Alternative solution

Alternatively you could try to keep track of all the state that needs to get cleaned up yourself. Eg, clearing the undo & redo stacks, cleaning up the trashcan state, etc. But I think that with this solution you'll inevitably miss things.

@palas palas self-assigned this May 10, 2021
@michaelpj michaelpj transferred this issue from IntersectMBO/plutus Oct 21, 2021
@nhenin nhenin transferred this issue from input-output-hk/marlowe-cardano Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants