Repository navigation
OCPBUGS-82111: contain hookProvider errors so a plugin cannot white-screen Console - #17433
Pratik-Redhat-Tech wants to merge 1 commit into
Conversation
…creen Console console.flag handlers already catch throws. console.flag/hookProvider handlers are React hooks, so they cannot use try/catch. Wrap each resolver in ErrorBoundary; FeatureFlagExtensionLoader sits outside the page boundary and a throw currently unmounts the whole app. Signed-off-by: Pratik Langde <plangde@redhat.com>
|
Pipeline controller notification This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration. Use |
|
@Pratik-Redhat-Tech: This pull request references Jira Issue OCPBUGS-82111, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Pratik-Redhat-Tech The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Pratik-Redhat-Tech. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Analysis / Root cause:
A throwing
console.flag/hookProviderhandler unmounts the entire OpenShift Console (spinner disappears, white screen).FeatureFlagExtensionLoadersits outside the pageErrorBoundary.console.flaghandlers already catch throws inuseFeatureFlagExtensions.hookProviderhandlers are React hooks, so they cannot usetry/catch(Rules of Hooks); they must be isolated with an error boundary.This matches the investigation on OCPBUGS-82111: an ACM feature-flag hook threw
TypeError(eis undefined when reading.name) after an empty components response, and React unmounted the root. The same path exists on 4.20, 4.22, and main.Solution description:
Wrap each
FeatureFlagExtensionHookResolverin the sharedErrorBoundary. One plugin hook failure is logged and contained; other plugins and the rest of the Console stay mounted. Default fallback is empty (these resolvers already rendernull).Test setup:
Standard console frontend unit tests:
yarn testTest cases:
console.flag/hookProviderthat throws during render (empty/undefined plugin data). The page must remain mounted; only that hook is isolated.console.flag(non-hook) handlers still catch errors as they do today.Browser conformance:
[X] Chrome
[X] Firefox
[X] Safari (or Epiphany on Linux)
Additional info:
Does not replace fixing ACM/MCE data handling. This is the Console-side containment gap called out on OCPBUGS-82111.
Made with Cursor
Summary by CodeRabbit