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

[release/8.0][browser] WebSocket works differently depending on if we look up its state or not #99673

Merged
merged 4 commits into from
Mar 28, 2024

Conversation

ilonatommy
Copy link
Member

@ilonatommy ilonatommy commented Mar 13, 2024

Backport of #99612, #99685 and (partially) #96618.

Fixes #99545.
Contributes to #96359

Description

We enhanced state change propagation - managed code does not get information about the socket having closed till all the messages are received. This prevents from losing messages (and throwing Unhandled exception rendering component: The WebSocket is in an invalid state ('Closed') for this operation. Valid states are: 'Open, CloseSent').

Customer Impact

The use case is quite narrow, user needs to connect to ws, send a message from server to client that is not immediately received and close the connection before the client receives it. If they check the ws state in between closing the socket and receiving the message, they will get an exception and will not be able to receive the message. This PR fixes it and they will be able to keep receiving the messages till the buffer is cleaned.

Regression

No.

Testing

This PR adds unit tests.

Risk

Small, it impacts only one specific use-case.

Copy link
Contributor

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

@ilonatommy ilonatommy added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Mar 15, 2024
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.

image

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 Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants