Content: guard PreviewMode postMessage against a detached iframe's null contentWindow - #4316
Open
github-actions[bot] wants to merge 1 commit into
Open
Content: guard PreviewMode postMessage against a detached iframe's null contentWindow#4316github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
3 tasks
Contributor
Author
QA Review — ✅ PASSValidates #4289: TypeError: Cannot read properties of null (reading 'postMessage')
Suggested Cypress coverage
|
Contributor
Author
Code Review — ✅ No blockers |
geodem127
approved these changes
Sep 1, 2026
finnar-bin
approved these changes
Sep 1, 2026
finnar-bin
added a commit
that referenced
this pull request
Sep 3, 2026
## Summary - Replace `claude-sentry-handler.yml`'s auto-fix commit path (`git config` + `git checkout -b` + `git add -A` + `git commit` + `git push`) with GitHub's Git Data API, called via a SHA-pinned `actions/github-script@v7` step, so auto-fix commits show GitHub's Verified badge. - Split the old "Open auto-fix PR" step into three: **Prepare auto-fix branch** (reads `branch_slug`/`pr_title`, captures dev HEAD's commit/tree SHA), **Create verified auto-fix commit** (builds blobs per touched file — preserving executable mode bits, representing deletions with `sha: null`, hard-failing on symlinks/non-regular files — then creates the tree/commit/ref via the API), and **Open auto-fix PR** (unchanged reviewer-access checks + `gh pr create`, now passing `--head` explicitly since there's no local checkout of the new branch). - Updated **Parse classification** to surface its already-computed `touched_files` list via `$GITHUB_OUTPUT` so the new step reuses it instead of recomputing it. ## Test plan - [x] `node --check` on the embedded github-script JS - [x] YAML parses - [x] Manual: trigger the Sentry auto-fix flow (or re-run `claude-sentry-handler.yml` via `workflow_dispatch`) and confirm the resulting commit shows the Verified badge ## Successful test run - #4316 Closes #4299 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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 #4289
Severity: low
Summary
PreviewMode.jscrashed withTypeError: Cannot read properties of null (reading 'postMessage')whenroute()ran against an iframe whosecontentWindowwas already null (the ref still pointed at a detached iframe node), tripping the app's error boundary.route()to also checkpreview.current.contentWindow, not justpreview.current, before callingpostMessage.Classification
preview.currentbeing truthy whilepreview.current.contentWindowis null (iframe detached from the DOM), and the existing guard only checked the former.src/apps/content-editor/src/app/components/Editor/PreviewMode/PreviewMode.js, none of it touches auth, permissions, IndexedDB hydration, RTK Query base config, webpack config, or workflow files.!preview.current→!preview.current?.contentWindow) that is a strict improvement in every case, not just the reported one.Test plan
postMessageTypeError is thrown and the error boundary doesn't trigger.