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: check if bubble is a child of Tooltip container before removing it #4821

Merged
merged 4 commits into from
Jun 9, 2022

Conversation

gabrielrra
Copy link
Contributor

@gabrielrra gabrielrra commented May 27, 2022

Closes #3986

There was a bug when removing a node from DOM using removeChild because it was trying to remove a node that was not a child.
I added a check to see if the Tooltip's bubble is a child of its container.
On issue #3986 there are a little more details about the bug

changelog(Fixes): Fixed an error when swapping between gRPC and HTTP requests

@victorradael
Copy link

This error is really very inconvenient, the people of my company will be very happy with this correction.

@marckong
Copy link
Contributor

Hi @gabrielrra thank you for contributing! It's awesome to see contributors like yourself helping insomnia keep going. I reviewed your PR and seems your fix is good. Just one thing that we would need to check is how this would affect the other tooltips. We are now removing the tooltip element conditionally based on _getContainer() result, which seems to pretty much guarantee the existence of the container element, but we may want to be safe, so let us double check on it. Thank you so much again for helping us improve it!

@marckong
Copy link
Contributor

@victorradael Thank you for adding another voice here!

@gabrielrra
Copy link
Contributor Author

Thanks for checking it out @marckong. Glad I could help

Copy link
Member

@filfreire filfreire left a comment

Choose a reason for hiding this comment

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

LGTM

@marckong
Copy link
Contributor

marckong commented Jun 9, 2022

I tested this against the latest develop branch. This change sufficiently fixes the issue addressed at #3986 whereas the develop branch still has the bug occur. Tooltip seems to behave fine in other areas too.

Copy link
Contributor

@marckong marckong left a comment

Choose a reason for hiding this comment

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

LGTM!

@marckong
Copy link
Contributor

marckong commented Jun 9, 2022

Thought I had after reviewing and learning about tooltip component is that we could possibly turn this into a functional component. I was initially suggesting a unit test to cover this case, but it may be better to do so when we refactor this component into functional component.

@marckong marckong merged commit 7b7a8c8 into Kong:develop Jun 9, 2022
@gabrielrra gabrielrra deleted the fix/grpc-tooltip-crash branch June 22, 2022 12:18
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.

Render Failure: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
4 participants