OCPBUGS-105314: Fix xterm ResizeObserver crash on uninitialized dimensions - #16918
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@ericahinkleRH: This pull request references Jira Issue OCPBUGS-105314, 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe terminal resize callback now catches exceptions across fitting, resize notification, and textarea synchronization. An exception stops the remaining resize processing. ChangesTerminal resize handling
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/pipeline required |
|
Scheduling tests matching the |
|
Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage. |
|
/test e2e-gcp-console-techpreview |
|
/test e2e-gcp-console |
2 similar comments
|
/test e2e-gcp-console |
|
/test e2e-gcp-console |
|
/test backend |
…sions The ResizeObserver callback accesses xterm's internal dimensions getter via fit.fit() and _syncTextArea(), both of which throw when the render service is partially initialized. Wrap the entire resize sequence in a try-catch so the callback safely skips the resize instead of crashing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
48eaa7b to
2c826a6
Compare
|
/jira refresh |
|
@TheRealJon: This pull request references Jira Issue OCPBUGS-105314, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
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. |
|
Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ericahinkleRH, sg00dwin, TheRealJon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/verified by CI |
|
@TheRealJon: This PR has been marked as verified by 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. |
|
@ericahinkleRH: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
1dfb9ea
into
openshift:main
|
@ericahinkleRH: Jira Issue Verification Checks: Jira Issue OCPBUGS-105314 Jira Issue OCPBUGS-105314 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓 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. |
Analysis / Root cause:
PR #16498 (OCPBUGS-84649, merged Jul 30) replaced the terminal resize logic in
terminal.tsxwith a ResizeObserver-based pattern. The guard on line 94 used optional chaining (_renderService?.dimensions) to check if xterm's render service was initialized, butdimensionsis a getter — when_renderServiceexists but is partially initialized, the getter throwsCannot read properties of undefined (reading 'dimensions')instead of returningundefined. This uncaught error fails any Cypress test that navigates to a debug terminal page, causing a 74% flake rate one2e-gcp-console.Solution description:
Replaced the broken optional chaining guard with a try-catch around
fit.fit(). If the fit addon throws because xterm's render service isn't ready, the callback safely returns without crashing.Screenshots / screen recording:
N/A — no visual changes.
Test setup:
N/A — fix is verified by existing
debug-pod.cy.tsCypress tests passing consistently.Test cases:
e2e-gcp-consoleCI passes without the debug-pod flakeBrowser conformance:
Additional info:
This bug has caused a 74% failure rate on
e2e-gcp-consolesince PR #16498 merged, affecting 17 unique PRs.Jira: https://issues.redhat.com/browse/OCPBUGS-105314
Reviewers and assignees:
/cc @jcaianirh
Summary by CodeRabbit