fix: WebSocket binaryType handling — stop unconditional Blob interception of binary messages - #16173
Conversation
* blob support * pr comments * pr comments * Update DefaultBlobResource.cpp
|
@microsoft/jshost allow me to review before approving. |
|
Julio César Rocha (@JunielKatarn) have you had a chance to review? |
|
Beginning review. |
|
I have submitted a PR to your branch adding a test for this use case which will eventually be part of our automation. The change looks correct. |
* Add WebSocketArrayBuffer headless test * Skip test by default
|
Julio César Rocha (@JunielKatarn) Comments addressed |
Performance Test ResultsBranch: ✅ Passed161 scenario(s) across 28 suite(s) — no regressionsSectionList
FlatList
TouchableOpacity
ScrollView
TouchableHighlight
Pressable
Modal
Image
ActivityIndicator
Switch
Button
TextInput
View
Text
SectionList.native-perf-test.ts
FlatList.native-perf-test.ts
TouchableHighlight.native-perf-test.ts
TouchableOpacity.native-perf-test.ts
Pressable.native-perf-test.ts
ScrollView.native-perf-test.ts
ActivityIndicator.native-perf-test.ts
TextInput.native-perf-test.ts
Switch.native-perf-test.ts
Button.native-perf-test.ts
Modal.native-perf-test.ts
Image.native-perf-test.ts
View.native-perf-test.ts
Text.native-perf-test.ts
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Andrew Coates (@acoates-ms) these are just the random failures right? Just needs a rerun? |
Looks like it. |
|
Merged |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Failing validation is due unrelated changes after the build image upgrade. |
Just pulled |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
5be8c05
into
microsoft:main
* Upgrade to PowerShell 7 (#16075) * Ran NuGetRestoreForceEvaluateAllSolutions.ps1 * Define installNuGetPackages task; Install pwsh 7.6.1 * Replace powershell.exe with pwsh.exe * Change files * CI: Ensure NuGet is availabe before `yarn install` * Add NuGetAuthenticate before yarn install * Do not download PowerShell on CI/CD environments * Fix just-task JS syntax * Add dotnet-tools manifest * Fix pwsh.exe tool path * Resolve dotnet-tools.json path * Use dotnet for `nuget locals` * Use PWSH in nuget-restore-task.js * Break dependency loop in just-task * Update other ADO tasks * Update @react-native-windows/automation * Rename findPwsh as findPowerShell * Drop powershell export from commandWithProgress * Change files * Add README for find-dotnet-tools * Add README to package.json * Adjust newline * Run task `installDotnetTools` only when not in CI * Install .NET tools in CI * Install .NET on prepare-js-env * Do not install .NET tools on CI * Quote powershell path * fix yarn lint * Ran NuGetRestoreForceEvaluateAllSolutions.ps1 * Restore deleted lock files * Add missing dependency * Use -Command for compatible PWSH calls * Use -Command pwsh argument * Correct runPowerShellScriptFunction cmd escaping * Quote pwsh command in runPowerShellScriptFunction * Remove quotes * Quote remaining findPowerShell() calls for execSync * Add temporary diagnostic commands * Diagnostics * Diagnostics * Diagnostics * Add runPowerShellScriptFunction argument to delegate Appx-related commands to Windows PowerShell * Remove diagnostics steps * Use execFileSync instead of execSync in deploy.ts * Remove querystrings from FS paths * Suppress warning when using `-UseWindowsPowerShell` * Revert "Remove querystrings from FS paths" This reverts commit e1f3cfd. * Use pipe semantics for Get-AppxPackage in resolveAppName * Hard-fail if PowerShell 7 cannot be found. Do not fall back to Windows PowerShell (powershell.exe). PowerShell code may not be backwards compatible. * Improve missing pwsh.exe error message * Add package resolution pipeline test * UseWindowsPowerShell for package resolution test * Try to read package Microsoft.PrintDialog * Replace stderr redirection with -WarningAction * Replace stderr redirection with -WarningAction * Print sample app names on appWindow error * Add more diagnostics * Add missing -WarningAction SilentlyContinue * Revert "Add more diagnostics" This reverts commit 8c10bc4. * Revert "Print sample app names on appWindow error" This reverts commit 6e70148. * Remove CI probing tasks * Revert "Use pipe semantics for Get-AppxPackage in resolveAppName" This reverts commit 6c46c73. Co-authored-by: Copilot <copilot@github.com> * Remove unused escaping logic * Re-introduce deleted .lock.json --------- Co-authored-by: Copilot <copilot@github.com> * Fix PowerShell installation (#16164) * Defer findPowershell to layoutMSRNCxx * Change files * Upgrade to Visual Studio 2026 (#16170) * Update deps script. TODO: test * Upgrade rnw-deps to .NET 10 * Defer findPowershell to layoutMSRNCxx * Upgrade VS version to 18.6.1 * Drop /async in MSVC 14.5 * Replace std::future coroutines with WinRT types * clang format * Change files * Drop Windows10SDK.19041 * Change files * Set TargetFramework to net10.0-windows10.0.26100.0 * Use IAsyncOperation instead of out parameters * Install .NET 10 * Revert "Install .NET 10" This reverts commit 5f75dc0. * Revert "Set TargetFramework to net10.0-windows10.0.26100.0" This reverts commit 22a4791. * clang format * Upgrade CsWinRT.csproj to .NET 8 * Fix filters * Upgrade MSRN SLN to VS 18 * Revert parameter signature in LoadBundleAsync * Update CSWinRT lock * Allow all versions of VS 2026 * Use IBuffer instead of hstring as payload GetJavaScriptFromServerAsync retuns bundle contents as hstring (16 bit) It then gets converted to an 8-bit string. This conversion drops bytes consideres "invalid". Those bytes are expected as part of the Hermes bundle header. Transmitting the bundle as an IBuffer preserves the original bytes and avoids the conversion issues. * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Use WinRT exception types instead of std --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Upgrade to GoogleTest Adapter 1.8.1.8 (#16218) * Upgrade to GoogleTest adapter 1.8.1.8 * Change files * Update package lock files * Upgrade CI agents to Windows Server 2025 (#16208) * Use image rnw-img-vs2026-node24 * Update fork-sync/bin.js chmod * Upgrade to MSVC 14.5 * Drop -UseWindowsPowerShell fallback * Manually install yarn * Upgrade to .NET Hosting Bundle 10.0.8 * Change files * Fix change file * Add temp npm install yarn in templates * Test yarn location * update * update * TEMPORARILY revert agent image * Print yarn version in setup * Revert "TEMPORARILY revert agent image" This reverts commit 7c175e1. * update * update * update * Upgrade to msbuildVersion: 18.0 * Update Google test adapter location * Remove unused statement * Remove probing tasks * Upgrade to VSTest@3 * Upgrade more projects and scripts to VS 2026 * Explicitly set vstest.console location * Install midgard-yarn and verdaccio in-place * Fix yarn version * Update node-tests version * Use pwsh in Add-AppDevPackage * Make WindowsStoreAppUtils use PowerShell 7 * Update snapshot values * Update snapshot from failing x86 run * Use the --tag argument for verdaccio under Node 24 * Ignore/warn on unstable click test * Enable WMIC for RN Doctor * Disable RN doctor until it drops WMIC * Add rnw-img-vs2026-node24.json (#16224) * Update CI verdaccio to 6.7.2 (#16223) * Upgrade to Microsoft.WindowsAppSDK 1.8.260508005 (#16225) * Upgrade to Microsoft.WindowsAppSDK 1.8.260508005 * Change files * fix: WebSocket binaryType handling — stop unconditional Blob interception of binary messages (#16173) * blob support (#8) * blob support * pr comments * pr comments * Update DefaultBlobResource.cpp * Create react-native-windows-c3827e14-777b-475a-bf00-dc169bf89f3d.json * Add WebSocketArrayBuffer headless test (#9) * Add WebSocketArrayBuffer headless test * Skip test by default * pr comments * Update overrides (#10) --------- Co-authored-by: Julio César Rocha <JunielKatarn@users.noreply.github.com> * Upgrade projects to .NET 10 (#16226) * Upgrade projects to .NET 10 * Upgrade lock files * Change files * Fix missing conflicts * Update packages lock * Remove extra yarn step * Re-introduce JS Desktop integration tests (#16228) * Remove redundant condition Desktop.IntegrationTests.SkipRNTester Modify Desktop.IntegrationTests.Filter instead. * Re-introduce WebSocket and WebSocketBlob tests * Make WSBlob test compare contents * Rename method to RunTest * Handle initial message from default endpoint * Change files * Migrate XHR test * Port Fetch test * Port Blob test * WebSocketMultipleSendTest * Remove JS WebSocket servers * Skip in CI for now * Remove ban-types * Fix DynamicReaderWriterTests * Use WinRT coroutine types for UwpScriptStore * clang format --------- Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Gordon MacMaster <31481849+gmacmaster@users.noreply.github.com>
* Upgrade to PowerShell 7 (#16075) * Ran NuGetRestoreForceEvaluateAllSolutions.ps1 * Define installNuGetPackages task; Install pwsh 7.6.1 * Replace powershell.exe with pwsh.exe * Change files * CI: Ensure NuGet is availabe before `yarn install` * Add NuGetAuthenticate before yarn install * Do not download PowerShell on CI/CD environments * Fix just-task JS syntax * Add dotnet-tools manifest * Fix pwsh.exe tool path * Resolve dotnet-tools.json path * Use dotnet for `nuget locals` * Use PWSH in nuget-restore-task.js * Break dependency loop in just-task * Update other ADO tasks * Update @react-native-windows/automation * Rename findPwsh as findPowerShell * Drop powershell export from commandWithProgress * Change files * Add README for find-dotnet-tools * Add README to package.json * Adjust newline * Run task `installDotnetTools` only when not in CI * Install .NET tools in CI * Install .NET on prepare-js-env * Do not install .NET tools on CI * Quote powershell path * fix yarn lint * Ran NuGetRestoreForceEvaluateAllSolutions.ps1 * Restore deleted lock files * Add missing dependency * Use -Command for compatible PWSH calls * Use -Command pwsh argument * Correct runPowerShellScriptFunction cmd escaping * Quote pwsh command in runPowerShellScriptFunction * Remove quotes * Quote remaining findPowerShell() calls for execSync * Add temporary diagnostic commands * Diagnostics * Diagnostics * Diagnostics * Add runPowerShellScriptFunction argument to delegate Appx-related commands to Windows PowerShell * Remove diagnostics steps * Use execFileSync instead of execSync in deploy.ts * Remove querystrings from FS paths * Suppress warning when using `-UseWindowsPowerShell` * Revert "Remove querystrings from FS paths" This reverts commit e1f3cfd. * Use pipe semantics for Get-AppxPackage in resolveAppName * Hard-fail if PowerShell 7 cannot be found. Do not fall back to Windows PowerShell (powershell.exe). PowerShell code may not be backwards compatible. * Improve missing pwsh.exe error message * Add package resolution pipeline test * UseWindowsPowerShell for package resolution test * Try to read package Microsoft.PrintDialog * Replace stderr redirection with -WarningAction * Replace stderr redirection with -WarningAction * Print sample app names on appWindow error * Add more diagnostics * Add missing -WarningAction SilentlyContinue * Revert "Add more diagnostics" This reverts commit 8c10bc4. * Revert "Print sample app names on appWindow error" This reverts commit 6e70148. * Remove CI probing tasks * Revert "Use pipe semantics for Get-AppxPackage in resolveAppName" This reverts commit 6c46c73. Co-authored-by: Copilot <copilot@github.com> * Remove unused escaping logic * Re-introduce deleted .lock.json --------- Co-authored-by: Copilot <copilot@github.com> * Fix PowerShell installation (#16164) * Defer findPowershell to layoutMSRNCxx * Change files * Upgrade to Visual Studio 2026 (#16170) * Update deps script. TODO: test * Upgrade rnw-deps to .NET 10 * Defer findPowershell to layoutMSRNCxx * Upgrade VS version to 18.6.1 * Drop /async in MSVC 14.5 * Replace std::future coroutines with WinRT types * clang format * Change files * Drop Windows10SDK.19041 * Change files * Set TargetFramework to net10.0-windows10.0.26100.0 * Use IAsyncOperation instead of out parameters * Install .NET 10 * Revert "Install .NET 10" This reverts commit 5f75dc0. * Revert "Set TargetFramework to net10.0-windows10.0.26100.0" This reverts commit 22a4791. * clang format * Upgrade CsWinRT.csproj to .NET 8 * Fix filters * Upgrade MSRN SLN to VS 18 * Revert parameter signature in LoadBundleAsync * Update CSWinRT lock * Allow all versions of VS 2026 * Use IBuffer instead of hstring as payload GetJavaScriptFromServerAsync retuns bundle contents as hstring (16 bit) It then gets converted to an 8-bit string. This conversion drops bytes consideres "invalid". Those bytes are expected as part of the Hermes bundle header. Transmitting the bundle as an IBuffer preserves the original bytes and avoids the conversion issues. * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Use WinRT exception types instead of std --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Upgrade to GoogleTest Adapter 1.8.1.8 (#16218) * Upgrade to GoogleTest adapter 1.8.1.8 * Change files * Update package lock files * Upgrade CI agents to Windows Server 2025 (#16208) * Use image rnw-img-vs2026-node24 * Update fork-sync/bin.js chmod * Upgrade to MSVC 14.5 * Drop -UseWindowsPowerShell fallback * Manually install yarn * Upgrade to .NET Hosting Bundle 10.0.8 * Change files * Fix change file * Add temp npm install yarn in templates * Test yarn location * update * update * TEMPORARILY revert agent image * Print yarn version in setup * Revert "TEMPORARILY revert agent image" This reverts commit 7c175e1. * update * update * update * Upgrade to msbuildVersion: 18.0 * Update Google test adapter location * Remove unused statement * Remove probing tasks * Upgrade to VSTest@3 * Upgrade more projects and scripts to VS 2026 * Explicitly set vstest.console location * Install midgard-yarn and verdaccio in-place * Fix yarn version * Update node-tests version * Use pwsh in Add-AppDevPackage * Make WindowsStoreAppUtils use PowerShell 7 * Update snapshot values * Update snapshot from failing x86 run * Use the --tag argument for verdaccio under Node 24 * Ignore/warn on unstable click test * Enable WMIC for RN Doctor * Disable RN doctor until it drops WMIC * Add rnw-img-vs2026-node24.json (#16224) * Update CI verdaccio to 6.7.2 (#16223) * Upgrade to Microsoft.WindowsAppSDK 1.8.260508005 (#16225) * Upgrade to Microsoft.WindowsAppSDK 1.8.260508005 * Change files * fix: WebSocket binaryType handling — stop unconditional Blob interception of binary messages (#16173) * blob support (#8) * blob support * pr comments * pr comments * Update DefaultBlobResource.cpp * Create react-native-windows-c3827e14-777b-475a-bf00-dc169bf89f3d.json * Add WebSocketArrayBuffer headless test (#9) * Add WebSocketArrayBuffer headless test * Skip test by default * pr comments * Update overrides (#10) --------- Co-authored-by: Julio César Rocha <JunielKatarn@users.noreply.github.com> * Upgrade projects to .NET 10 (#16226) * Upgrade projects to .NET 10 * Upgrade lock files * Change files * Update yarn lock * Re-introduce JS Desktop integration tests (#16228) * Remove redundant condition Desktop.IntegrationTests.SkipRNTester Modify Desktop.IntegrationTests.Filter instead. * Re-introduce WebSocket and WebSocketBlob tests * Make WSBlob test compare contents * Rename method to RunTest * Handle initial message from default endpoint * Change files * Migrate XHR test * Port Fetch test * Port Blob test * WebSocketMultipleSendTest * Remove JS WebSocket servers * Skip in CI for now * Update yarn lock * Add missing find-dotnet-tools * Fix DynamicReaderWriterTests * Update yarn lock * Use WinRT coroutine types for UwpScriptStore * clang format --------- Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Gordon MacMaster <31481849+gmacmaster@users.noreply.github.com>
* Upgrade to PowerShell 7 (#16075) * Ran NuGetRestoreForceEvaluateAllSolutions.ps1 * Define installNuGetPackages task; Install pwsh 7.6.1 * Replace powershell.exe with pwsh.exe * Change files * CI: Ensure NuGet is availabe before `yarn install` * Add NuGetAuthenticate before yarn install * Do not download PowerShell on CI/CD environments * Fix just-task JS syntax * Add dotnet-tools manifest * Fix pwsh.exe tool path * Resolve dotnet-tools.json path * Use dotnet for `nuget locals` * Use PWSH in nuget-restore-task.js * Break dependency loop in just-task * Update other ADO tasks * Update @react-native-windows/automation * Rename findPwsh as findPowerShell * Drop powershell export from commandWithProgress * Change files * Add README for find-dotnet-tools * Add README to package.json * Adjust newline * Run task `installDotnetTools` only when not in CI * Install .NET tools in CI * Install .NET on prepare-js-env * Do not install .NET tools on CI * Quote powershell path * fix yarn lint * Ran NuGetRestoreForceEvaluateAllSolutions.ps1 * Restore deleted lock files * Add missing dependency * Use -Command for compatible PWSH calls * Use -Command pwsh argument * Correct runPowerShellScriptFunction cmd escaping * Quote pwsh command in runPowerShellScriptFunction * Remove quotes * Quote remaining findPowerShell() calls for execSync * Add temporary diagnostic commands * Diagnostics * Diagnostics * Diagnostics * Add runPowerShellScriptFunction argument to delegate Appx-related commands to Windows PowerShell * Remove diagnostics steps * Use execFileSync instead of execSync in deploy.ts * Remove querystrings from FS paths * Suppress warning when using `-UseWindowsPowerShell` * Revert "Remove querystrings from FS paths" This reverts commit e1f3cfd. * Use pipe semantics for Get-AppxPackage in resolveAppName * Hard-fail if PowerShell 7 cannot be found. Do not fall back to Windows PowerShell (powershell.exe). PowerShell code may not be backwards compatible. * Improve missing pwsh.exe error message * Add package resolution pipeline test * UseWindowsPowerShell for package resolution test * Try to read package Microsoft.PrintDialog * Replace stderr redirection with -WarningAction * Replace stderr redirection with -WarningAction * Print sample app names on appWindow error * Add more diagnostics * Add missing -WarningAction SilentlyContinue * Revert "Add more diagnostics" This reverts commit 8c10bc4. * Revert "Print sample app names on appWindow error" This reverts commit 6e70148. * Remove CI probing tasks * Revert "Use pipe semantics for Get-AppxPackage in resolveAppName" This reverts commit 6c46c73. Co-authored-by: Copilot <copilot@github.com> * Remove unused escaping logic * Re-introduce deleted .lock.json --------- Co-authored-by: Copilot <copilot@github.com> * Fix PowerShell installation (#16164) * Defer findPowershell to layoutMSRNCxx * Change files * Upgrade to Visual Studio 2026 (#16170) * Update deps script. TODO: test * Upgrade rnw-deps to .NET 10 * Defer findPowershell to layoutMSRNCxx * Upgrade VS version to 18.6.1 * Drop /async in MSVC 14.5 * Replace std::future coroutines with WinRT types * clang format * Change files * Drop Windows10SDK.19041 * Change files * Set TargetFramework to net10.0-windows10.0.26100.0 * Use IAsyncOperation instead of out parameters * Install .NET 10 * Revert "Install .NET 10" This reverts commit 5f75dc0. * Revert "Set TargetFramework to net10.0-windows10.0.26100.0" This reverts commit 22a4791. * clang format * Upgrade CsWinRT.csproj to .NET 8 * Fix filters * Upgrade MSRN SLN to VS 18 * Revert parameter signature in LoadBundleAsync * Update CSWinRT lock * Allow all versions of VS 2026 * Use IBuffer instead of hstring as payload GetJavaScriptFromServerAsync retuns bundle contents as hstring (16 bit) It then gets converted to an 8-bit string. This conversion drops bytes consideres "invalid". Those bytes are expected as part of the Hermes bundle header. Transmitting the bundle as an IBuffer preserves the original bytes and avoids the conversion issues. * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Use WinRT exception types instead of std --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Upgrade to GoogleTest Adapter 1.8.1.8 (#16218) * Upgrade to GoogleTest adapter 1.8.1.8 * Change files * Update package lock files * Upgrade CI agents to Windows Server 2025 (#16208) * Use image rnw-img-vs2026-node24 * Update fork-sync/bin.js chmod * Upgrade to MSVC 14.5 * Drop -UseWindowsPowerShell fallback * Manually install yarn * Upgrade to .NET Hosting Bundle 10.0.8 * Change files * Fix change file * Add temp npm install yarn in templates * Test yarn location * update * update * TEMPORARILY revert agent image * Print yarn version in setup * Revert "TEMPORARILY revert agent image" This reverts commit 7c175e1. * update * update * update * Upgrade to msbuildVersion: 18.0 * Update Google test adapter location * Remove unused statement * Remove probing tasks * Upgrade to VSTest@3 * Upgrade more projects and scripts to VS 2026 * Explicitly set vstest.console location * Install midgard-yarn and verdaccio in-place * Fix yarn version * Update node-tests version * Use pwsh in Add-AppDevPackage * Make WindowsStoreAppUtils use PowerShell 7 * Update snapshot values * Update snapshot from failing x86 run * Use the --tag argument for verdaccio under Node 24 * Ignore/warn on unstable click test * Enable WMIC for RN Doctor * Disable RN doctor until it drops WMIC * Add rnw-img-vs2026-node24.json (#16224) * Update CI verdaccio to 6.7.2 (#16223) * Upgrade to Microsoft.WindowsAppSDK 1.8.260508005 (#16225) * Upgrade to Microsoft.WindowsAppSDK 1.8.260508005 * Change files * fix: WebSocket binaryType handling — stop unconditional Blob interception of binary messages (#16173) * blob support (#8) * blob support * pr comments * pr comments * Update DefaultBlobResource.cpp * Create react-native-windows-c3827e14-777b-475a-bf00-dc169bf89f3d.json * Add WebSocketArrayBuffer headless test (#9) * Add WebSocketArrayBuffer headless test * Skip test by default * pr comments * Update overrides (#10) --------- Co-authored-by: Julio César Rocha <JunielKatarn@users.noreply.github.com> * Upgrade projects to .NET 10 (#16226) * Upgrade projects to .NET 10 * Upgrade lock files * Change files * Remove nuget restore task * Re-introduce JS Desktop integration tests (#16228) * Remove redundant condition Desktop.IntegrationTests.SkipRNTester Modify Desktop.IntegrationTests.Filter instead. * Re-introduce WebSocket and WebSocketBlob tests * Make WSBlob test compare contents * Rename method to RunTest * Handle initial message from default endpoint * Change files * Migrate XHR test * Port Fetch test * Port Blob test * WebSocketMultipleSendTest * Remove JS WebSocket servers * Skip in CI for now * Add missing find-dotnet-tool entries * Update package locks * Fix DynamicReaderWriterTests * Fix HermesSamplingProfiler for MSVC 14.5 * Update package locks * Use WinRT coroutine types for UwpScriptStore --------- Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Gordon MacMaster <31481849+gmacmaster@users.noreply.github.com>
* Upgrade to PowerShell 7 (#16075) * Ran NuGetRestoreForceEvaluateAllSolutions.ps1 * Define installNuGetPackages task; Install pwsh 7.6.1 * Replace powershell.exe with pwsh.exe * Change files * CI: Ensure NuGet is availabe before `yarn install` * Add NuGetAuthenticate before yarn install * Do not download PowerShell on CI/CD environments * Fix just-task JS syntax * Add dotnet-tools manifest * Fix pwsh.exe tool path * Resolve dotnet-tools.json path * Use dotnet for `nuget locals` * Use PWSH in nuget-restore-task.js * Break dependency loop in just-task * Update other ADO tasks * Update @react-native-windows/automation * Rename findPwsh as findPowerShell * Drop powershell export from commandWithProgress * Change files * Add README for find-dotnet-tools * Add README to package.json * Adjust newline * Run task `installDotnetTools` only when not in CI * Install .NET tools in CI * Install .NET on prepare-js-env * Do not install .NET tools on CI * Quote powershell path * fix yarn lint * Ran NuGetRestoreForceEvaluateAllSolutions.ps1 * Restore deleted lock files * Add missing dependency * Use -Command for compatible PWSH calls * Use -Command pwsh argument * Correct runPowerShellScriptFunction cmd escaping * Quote pwsh command in runPowerShellScriptFunction * Remove quotes * Quote remaining findPowerShell() calls for execSync * Add temporary diagnostic commands * Diagnostics * Diagnostics * Diagnostics * Add runPowerShellScriptFunction argument to delegate Appx-related commands to Windows PowerShell * Remove diagnostics steps * Use execFileSync instead of execSync in deploy.ts * Remove querystrings from FS paths * Suppress warning when using `-UseWindowsPowerShell` * Revert "Remove querystrings from FS paths" This reverts commit e1f3cfd. * Use pipe semantics for Get-AppxPackage in resolveAppName * Hard-fail if PowerShell 7 cannot be found. Do not fall back to Windows PowerShell (powershell.exe). PowerShell code may not be backwards compatible. * Improve missing pwsh.exe error message * Add package resolution pipeline test * UseWindowsPowerShell for package resolution test * Try to read package Microsoft.PrintDialog * Replace stderr redirection with -WarningAction * Replace stderr redirection with -WarningAction * Print sample app names on appWindow error * Add more diagnostics * Add missing -WarningAction SilentlyContinue * Revert "Add more diagnostics" This reverts commit 8c10bc4. * Revert "Print sample app names on appWindow error" This reverts commit 6e70148. * Remove CI probing tasks * Revert "Use pipe semantics for Get-AppxPackage in resolveAppName" This reverts commit 6c46c73. Co-authored-by: Copilot <copilot@github.com> * Remove unused escaping logic * Re-introduce deleted .lock.json --------- Co-authored-by: Copilot <copilot@github.com> * Fix PowerShell installation (#16164) * Defer findPowershell to layoutMSRNCxx * Change files * Upgrade to Visual Studio 2026 (#16170) * Update deps script. TODO: test * Upgrade rnw-deps to .NET 10 * Defer findPowershell to layoutMSRNCxx * Upgrade VS version to 18.6.1 * Drop /async in MSVC 14.5 * Replace std::future coroutines with WinRT types * clang format * Change files * Drop Windows10SDK.19041 * Change files * Set TargetFramework to net10.0-windows10.0.26100.0 * Use IAsyncOperation instead of out parameters * Install .NET 10 * Revert "Install .NET 10" This reverts commit 5f75dc0. * Revert "Set TargetFramework to net10.0-windows10.0.26100.0" This reverts commit 22a4791. * clang format * Upgrade CsWinRT.csproj to .NET 8 * Fix filters * Upgrade MSRN SLN to VS 18 * Revert parameter signature in LoadBundleAsync * Update CSWinRT lock * Allow all versions of VS 2026 * Use IBuffer instead of hstring as payload GetJavaScriptFromServerAsync retuns bundle contents as hstring (16 bit) It then gets converted to an 8-bit string. This conversion drops bytes consideres "invalid". Those bytes are expected as part of the Hermes bundle header. Transmitting the bundle as an IBuffer preserves the original bytes and avoids the conversion issues. * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Use WinRT exception types instead of std --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Upgrade to GoogleTest Adapter 1.8.1.8 (#16218) * Upgrade to GoogleTest adapter 1.8.1.8 * Change files * Update package lock files * Upgrade CI agents to Windows Server 2025 (#16208) * Use image rnw-img-vs2026-node24 * Update fork-sync/bin.js chmod * Upgrade to MSVC 14.5 * Drop -UseWindowsPowerShell fallback * Manually install yarn * Upgrade to .NET Hosting Bundle 10.0.8 * Change files * Fix change file * Add temp npm install yarn in templates * Test yarn location * update * update * TEMPORARILY revert agent image * Print yarn version in setup * Revert "TEMPORARILY revert agent image" This reverts commit 7c175e1. * update * update * update * Upgrade to msbuildVersion: 18.0 * Update Google test adapter location * Remove unused statement * Remove probing tasks * Upgrade to VSTest@3 * Upgrade more projects and scripts to VS 2026 * Explicitly set vstest.console location * Install midgard-yarn and verdaccio in-place * Fix yarn version * Update node-tests version * Use pwsh in Add-AppDevPackage * Make WindowsStoreAppUtils use PowerShell 7 * Update snapshot values * Update snapshot from failing x86 run * Use the --tag argument for verdaccio under Node 24 * Ignore/warn on unstable click test * Enable WMIC for RN Doctor * Disable RN doctor until it drops WMIC * Add rnw-img-vs2026-node24.json (#16224) * Update CI verdaccio to 6.7.2 (#16223) * Upgrade to Microsoft.WindowsAppSDK 1.8.260508005 (#16225) * Upgrade to Microsoft.WindowsAppSDK 1.8.260508005 * Change files * fix: WebSocket binaryType handling — stop unconditional Blob interception of binary messages (#16173) * blob support (#8) * blob support * pr comments * pr comments * Update DefaultBlobResource.cpp * Create react-native-windows-c3827e14-777b-475a-bf00-dc169bf89f3d.json * Add WebSocketArrayBuffer headless test (#9) * Add WebSocketArrayBuffer headless test * Skip test by default * pr comments * Update overrides (#10) --------- Co-authored-by: Julio César Rocha <JunielKatarn@users.noreply.github.com> * Upgrade projects to .NET 10 (#16226) * Upgrade projects to .NET 10 * Upgrade lock files * Change files * Update yarn lock * Re-introduce JS Desktop integration tests (#16228) * Remove redundant condition Desktop.IntegrationTests.SkipRNTester Modify Desktop.IntegrationTests.Filter instead. * Re-introduce WebSocket and WebSocketBlob tests * Make WSBlob test compare contents * Rename method to RunTest * Handle initial message from default endpoint * Change files * Migrate XHR test * Port Fetch test * Port Blob test * WebSocketMultipleSendTest * Remove JS WebSocket servers * Skip in CI for now * Update yarn lock * Remove ban-types * Fix DynamicReaderWriterTests * Use WinRT coroutine types for UwpScriptStore * clang format * yarn lint --------- Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Gordon MacMaster <31481849+gmacmaster@users.noreply.github.com>
Description
WebSocket binaryType = 'arraybuffer' is silently broken on React Native Windows.
Type of Change
Bug fix (non-breaking change which fixes an issue)
Why
WebSocket binaryType = 'arraybuffer' is silently broken on React Native Windows. All binary WebSocket messages are unconditionally intercepted by BlobWebSocketModuleContentHandler and converted to Blobs, regardless of whether the socket has been registered for blob handling via addWebSocketHandler. This means:
Setting binaryType = 'arraybuffer' has no effect — binary messages still arrive as Blobs
The JavaScript-side WebSocket.js never executes its base64-to-ArrayBuffer conversion path for binary messages
Applications relying on ArrayBuffer delivery (e.g., PowerSync, binary protocol clients) are forced to implement custom Blob-to-ArrayBuffer conversion patches
This diverges from the behavior on iOS and Android, where binaryType correctly controls binary message delivery format.
What
The root cause is in DefaultBlobResource.cpp: IBlobResource::Make() unconditionally registers a BlobWebSocketModuleContentHandler on the ReactContext property bag, and WebSocketModule.cpp routes all binary messages through it without checking whether the specific socket was registered via addWebSocketHandler.
The BlobWebSocketModuleContentHandler already tracks registered socket IDs in m_socketIds (populated by Register/Unregister), but this set was never consulted during message processing.
Changes across 4 files:
IWebSocketModuleContentHandler.h — Changed both ProcessMessage overloads from void to bool return type. true = message was handled by the content handler; false = caller should fall back to default delivery.
DefaultBlobResource.h — Updated BlobWebSocketModuleContentHandler::ProcessMessage signatures to return bool.
DefaultBlobResource.cpp — Both ProcessMessage overloads now read the socket ID from params["id"], acquire m_mutex, and check m_socketIds. If the socket is not registered, they return false without processing. This check is atomic with the message processing, avoiding any TOCTOU gap between a separate Supports() check and ProcessMessage.
WebSocketModule.cpp — The SetOnMessage callback now checks the bool return value from ProcessMessage. If false, it falls through to the default path (args["data"] = message), which delivers the base64-encoded binary data to JavaScript where WebSocket.js decodes it to an ArrayBuffer.
Behavior after the fix:
binaryType = 'blob' (socket registered via addWebSocketHandler) — binary messages delivered as Blobs, same as before.
binaryType = 'arraybuffer' or default (socket not registered) — binary messages delivered as ArrayBuffer via the standard JS-side base64 decode path.
Screenshots
N/A — this is a data-path fix with no UI changes. Verified by observing WebSocket message delivery type in application-level diagnostics.
Testing
Verified end-to-end on a Windows device running a React Native application with PowerSync (real-time sync over binary WebSocket):
Before fix: All binary messages hit Blob conversion path (fileReader branch in application diagnostic stats), binaryType = 'arraybuffer' caused silent message drops.
After fix: All binary messages hit the passthrough/ArrayBuffer path (passthrough branch active, fileReader: 0), no message drops.
Tested both binaryType modes:
'arraybuffer' — messages arrive as ArrayBuffer in MessageEvent.data (was broken, now works)
'blob' — messages arrive as Blob in MessageEvent.data (still works, no regression)
Changelog
Should this change be included in the release notes: yes
Fix WebSocket binaryType handling on Windows — binary messages are no longer unconditionally converted to Blobs. Sockets using binaryType = 'arraybuffer' (the standard default) now correctly receive ArrayBuffer data.
Microsoft Reviewers: Open in CodeFlow