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 a bug with node deletion #132

Closed
wants to merge 3 commits into from
Closed

Conversation

mihna123
Copy link

What does this PR do?

It fixes a bug with node deletion. The bug happens when you send data with some nodes missing (because you deleted them) to TreeView component, and you want to have all nodes expanded with expandedId prop. This small fix just checks if node is still in the tree before trying to collapse it, otherwise the exception "Node with id=x doesn't exist in the tree" will be thrown.

@dgreene1
Copy link
Owner

@mihna123 we need to have an issue that explains the defect before we get a PR.

Also, we can’t merge code that doesn’t have a unit test. If there is a bug, we’ll need to make sure that the unit test fails when your code is missing and passes once your fix is present.

@mihna123
Copy link
Author

@mihna123 we need to have an issue that explains the defect before we get a PR.

Also, we can’t merge code that doesn’t have a unit test. If there is a bug, we’ll need to make sure that the unit test fails when your code is missing and passes once your fix is present.

Sorry, i will make an issue then

@mihna123
Copy link
Author

@dgreene1 here is the issue #133

@callwait
Copy link

I faced this issue as well, can you merge it?

@dgreene1
Copy link
Owner

@mihna123 this PR lacks unit tests. In order for us to know that the bug is fixed, we need a unit test. This will also ensure that it does not regress in the future, as long as the test fails when your fix is removed and passes when your fix is present.

cc @callwait

Copy link
Owner

@dgreene1 dgreene1 left a comment

Choose a reason for hiding this comment

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

unit tests are required. Within this tests, please make sure that you don’t call setData inside of a recursive function like I mention in #133 (comment)

@stale
Copy link

stale bot commented Oct 13, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Oct 13, 2023
@stale
Copy link

stale bot commented Oct 20, 2023

This issue was closed automatically since it was marked as stale because it has not had recent activity. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants