[0.81] Cherry picking Image use-after-free and make powershell lookup lazy - #16433
Merged
Andrew Coates (acoates-ms) merged 4 commits intoSep 9, 2026
Merged
Conversation
…n macOS when react-native.config.js is loaded (microsoft#16430) * Defer PowerShell discovery until command or health check execution * Remove standalone PowerShell discovery tests * Fix conditional assignment for powershell variable Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * add try-catch * separate from try-catch * capitalisation --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Andrew Coates (acoates-ms)
September 8, 2026 16:00
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
PowerShell lookup errors currently bypass operation-specific error handling, and one addition fails repository formatting.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Backports image-lifetime safety and lazy PowerShell discovery fixes to RNW 0.81.
Changes:
- Marshals image notifications onto the UI thread.
- Defers and caches PowerShell lookup.
- Adds patch change records.
File summaries
| File | Description |
|---|---|
WindowsImageManager.cpp |
Prevents image observer teardown races. |
commandWithProgress.ts |
Lazily resolves PowerShell. |
healthChecks.ts |
Defers health-check PowerShell lookup. |
react-native-windows-*.json |
Records the image fix. |
@react-native-windows-cli-*.json |
Records the CLI fix. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+61
to
64
| powershell ??= findPowerShell(); | ||
|
|
||
| try { | ||
| const printException = verbose ? '$_;' : ''; |
| const errorMessage = error instanceof Error ? error.message : undefined; | ||
| logManualInstallation({ | ||
| healthcheck: `react-native-windows dependency "${id}"`, | ||
| message: `Error finding PowerShell${errorMessage ? `: ${errorMessage}` : ""}` |
Tommy Nguyen (tido64)
approved these changes
Sep 8, 2026
Copilot started reviewing on behalf of
Andrew Coates (acoates-ms)
September 8, 2026 17:10
View session
Andrew Coates (acoates-ms)
merged commit Sep 9, 2026
87ecc02
into
microsoft:0.81-stable
36 checks passed
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.
Cherry picking #16345 and #16430
Microsoft Reviewers: Open in CodeFlow