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

Fix corruption of skeleton when using CTRL+Rightclick in empty tree #5385

Merged
merged 3 commits into from
Apr 12, 2021

Conversation

philippotto
Copy link
Member

@philippotto philippotto commented Apr 8, 2021

The bug has two facets:

  1. Using ctrl+rightclick to add a tree does not select and also not center it. This means, using ctrl+rightclick in an empty tree twice, will try to create two nodes within the same tree. However, if no node is selected, no edge can be constructed for the second node which produces the corruption.
  2. The addNode reducer helper simply added a node when being told so and only created an edge, if a node was selected. This means, if no node is selected (for whatever reason), corruption can ensue when the tree is not-empty. This should not happen in theory, but (1) provoked this scenario.

To fix this bug, I did 2 things:

  1. Ensure that ctrl+rightclick also selects the first node of a tree (it's still not centered). I think, this is a fair behavior.
  2. I adapted the addNode code so that the corruption cannot happen even if the circumstances would provoke it. The reducer would simply do a noop instead (and log an error message to the console).

URL of deployed dev instance (used for testing):

Steps to test:

  • Create/Activate an empty tree
  • Use Ctrl + Rightclick to create a first node
  • Use Ctrl + Rightclick to create a second node

Issues:


…de of a tree is always selected after creation
@philippotto philippotto requested a review from daniel-wer April 8, 2021 15:17
@philippotto philippotto self-assigned this Apr 8, 2021
Copy link
Member

@daniel-wer daniel-wer left a comment

Choose a reason for hiding this comment

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

Very nice solution! 👍

@philippotto philippotto enabled auto-merge (squash) April 12, 2021 11:07
@philippotto philippotto merged commit 004b64f into master Apr 12, 2021
@philippotto philippotto deleted the fix-corrupt-trees branch June 14, 2022 11:37
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.

Ctrl + Rightclick causes skeleton annotation corruption
2 participants