Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[browser][ws] Fix WebSocket state propagation delay in ReceiveAsync #99612

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

ilonatommy
Copy link
Member

@ilonatommy ilonatommy commented Mar 12, 2024

Fix #99545.
Contributes to #96359

We should not inform managed code about ws Closed status till all the messages from the event buffer that is populated on onMessage don't get read. This gives the client an opportunity to read all the messages even when the socket is already closed + removes the inconsistency in behavior.

@ilonatommy ilonatommy added arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm labels Mar 12, 2024
@ilonatommy ilonatommy self-assigned this Mar 12, 2024
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@pavelsavara pavelsavara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

@ilonatommy ilonatommy requested review from pavelsavara and maraf March 13, 2024 09:53
@ilonatommy ilonatommy merged commit 9a67fc8 into dotnet:main Mar 13, 2024
122 checks passed
@ilonatommy
Copy link
Member Author

/backport to release/8.0-staging

Copy link
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/8262843184

Copy link
Contributor

@ilonatommy backporting to release/8.0-staging failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix + test.
Using index info to reconstruct a base tree...
M	src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserInterop.cs
M	src/libraries/System.Net.WebSockets.Client/tests/CloseTest.cs
A	src/mono/browser/runtime/exports-internal.ts
A	src/mono/browser/runtime/web-socket.ts
Falling back to patching base and 3-way merge...
Auto-merging src/mono/wasm/runtime/web-socket.ts
CONFLICT (content): Merge conflict in src/mono/wasm/runtime/web-socket.ts
Auto-merging src/mono/wasm/runtime/exports-internal.ts
Auto-merging src/libraries/System.Net.WebSockets.Client/tests/CloseTest.cs
Auto-merging src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserInterop.cs
CONFLICT (content): Merge conflict in src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserInterop.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix + test.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link
Contributor

@ilonatommy an error occurred while backporting to release/8.0-staging, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[browser][ws] WebSocket works differently depending on if we look up its state or not
3 participants