N/A: Add ErrorBoundary for the SaveArticleButton - #14326
Draft
elvinasv wants to merge 2 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves JIRA:
Summary
NotFoundError: Failed to execute 'insertBefore' on 'Node'). This happens because Chrome Translate rewrites text nodes in the DOM (wrapping them in its own elements) outside of React's control. When the save action then triggers a state update and React tries to re-render the button (swapping icons and label text as siblings within the same element), React's reconciler tries to insert/remove DOM nodes at positions that no longer match what Chrome Translate left behind, throwing the error and crashing the app. This is a known class of conflict between browser translation tools and React's DOM reconciliation, not a logic bug in the save button itself.ErrorBoundarycomponent was added aroundSaveArticleButtonso that if this (or any other runtime error) does occur in that widget, it no longer takes down the whole article page — the error is caught, logged, and the widget fails gracefully instead.Code changes
Testing
Useful Links