-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(feedback): Fix an issue where, if removeFromDom() is called it might throw #16030
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
base: develop
Are you sure you want to change the base?
Conversation
❌ We are unable to process any of the uploaded JUnit XML files. Please ensure your files are in the right format. |
logger.error( | ||
'[Feedback] Error when trying to remove Actor from the DOM. It is not appended to the DOM yet!', | ||
); | ||
throw new Error('[Feedback] Actor is not appended to DOM, nothing to remove.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you want to throw this one here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
turns out el.remove()
doesn't even throw if there's no parent element. unlike parent.removeChild(child)
.
So now if people call removeFromDom()
we'll basically guarantee that the elements will be removed, and there'll be no errors thrown.
Similar to the appendToDom()
call, SDK users can't really tell what state things are currently in, but they can call methods to put things into the state you want to be in.
7a904c7
to
18c9875
Compare
96483aa
to
0463304
Compare
0463304
to
b85449b
Compare
size-limit report 📦
|
An internal user reported seeing "NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node." and the replay of their session confirms it: https://sentry.sentry.io/explore/replays/127444034ae84099a84b524458b6dd90/
However, there is no matching JS error to give more clues.
What I think happened is that after interacting with the Feedback SDK the widget got into a state where it was no longer mounted into the page, but we called
removeFromDom()
anyway.Looking at the replay i saw the moment when the feedback dom was aded to the page, but it wasn't visible, only this got added at 18:51:

So something prevented it from opening all the way up.
Fixes getsentry/sentry#89424