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

Prevent TrackScheme From Freezing When Removing A Root Spot #312

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

maarzt
Copy link
Contributor

@maarzt maarzt commented Jun 17, 2024

This PR fixes a bug that causes the TrackScheme window to freeze after the following two steps:

  1. Use "View > Show Only Selected Tracks"
  2. Delete one of the visible root nodes

Here is a screen cast, demonstrating how to reproduce the problem:

trackscheme-roots-bug

The bug is triggered because the DefaultRootsModel and BranchTrackSchemeRootsModel keep a list of roots to be shown in the TrackScheme view. If one of the roots is removed from the ModelGraph, it becomes invalid, but the invalid entry still remains in the list of roots. The exception is triggered when the invalid object is processed by the PainterThread.

This PR fixes the bug, by removing the invalid entry from the list of roots as soon as the corresponding Spot is removed from the ModelGraph.

maarzt added 2 commits June 17, 2024 14:51
There was a bug, that could be reproduced as follows:
Open a Mastodon project with multiple tracks.
Select a few tracks and click "View > Show Only Selected Tracks".
Remove one of the tracks.
Result: TrackScheme window would freeze and the console would show
NullPointerException.

The bug is triggered because the DefaultRootsModel and
BranchTrackSchemeRootsModel keep a list of roots to be shown in the
TrackScheme view. If one of the root is removed from the ModelGraph, it
becomes invalid, but the invalid entry still remains in the list of roots.
The exception is triggered when the invalid object is processed later on.

This commit fixes this bug, by removing the a entry fro the list of roots
as soon the corresponding Spot is removed from the ModelGraph.
@maarzt maarzt requested a review from tinevez June 17, 2024 13:15
@maarzt maarzt changed the title Fix roots model remove root Prevent TrackScheme From Freezing When Removing A Root Jun 17, 2024
@maarzt maarzt changed the title Prevent TrackScheme From Freezing When Removing A Root Prevent TrackScheme From Freezing When Removing A Root Spot Jun 17, 2024
@maarzt
Copy link
Contributor Author

maarzt commented Jun 24, 2024

@tinevez Disclaimer: The bug that is fixed in this PR was introduced by me. So I'm the one to blame here.

@tinevez tinevez merged commit f774392 into dev Jun 26, 2024
1 check passed
@tinevez tinevez deleted the fix-roots-model-remove-root branch June 26, 2024 09:41
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

Successfully merging this pull request may close these issues.

2 participants