-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add "allowReconnect" to SignalR CloseMessages #14908
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
Conversation
| public static readonly Microsoft.AspNetCore.SignalR.Protocol.CloseMessage Empty; | ||
| public CloseMessage(string error) { } | ||
| public CloseMessage(string error, bool allowAutomaticReconnect) { } | ||
| public bool AllowAutomaticReconnect { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the new API @davidfowl
|
As a reminder: Do not merge until I post back indicating we have approval from the release QB |
BrennanConroy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also update the spec doc
Tests should be added to https://github.com/aspnet/AspNetCore/blob/9557630c0a470618b30679e8effcf019b1c74164/src/SignalR/common/SignalR.Common/test/Internal/Protocol/JsonHubProtocolTestsBase.cs#L36 and https://github.com/aspnet/AspNetCore/blob/9557630c0a470618b30679e8effcf019b1c74164/src/SignalR/common/SignalR.Common/test/Internal/Protocol/MessagePackHubProtocolTestBase.cs#L63
src/SignalR/clients/csharp/Client/test/UnitTests/HubConnectionTests.Reconnect.cs
Outdated
Show resolved
Hide resolved
src/SignalR/common/Protocols.MessagePack/src/Protocol/MessagePackHubProtocol.cs
Outdated
Show resolved
Hide resolved
src/SignalR/common/Protocols.MessagePack/src/Protocol/MessagePackHubProtocol.cs
Outdated
Show resolved
Hide resolved
| { | ||
| reader.Read(); | ||
|
|
||
| return reader.TokenType switch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woah, is this that new pattern matching feature
+Pranav Points
src/SignalR/clients/ts/signalr-protocol-msgpack/src/MessagePackHubProtocol.ts
Show resolved
Hide resolved
aad9b2a to
b4c3a38
Compare
|
I put the "NO MERGE" label on just to make clear that we're pending approval for 3.1. |
b4c3a38 to
1f00a16
Compare
|
Approved for 3.1. Please explcitly confirm that cross-version compat testing of this functionality has been done (3.0 client to 3.1 server, 3.1 client to 3.0 server). I've added a checklist you can use to do that to the main description. Approval confirmation: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1001918/ |
1f00a16 to
a0b34d6
Compare
BrennanConroy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like the protocol spec to be updated too.
|
/azp run AspNetCore-ci |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| public static readonly Microsoft.AspNetCore.SignalR.Protocol.CloseMessage Empty; | ||
| public CloseMessage(string error) { } | ||
| public CloseMessage(string error, bool allowReconnect) { } | ||
| public bool AllowReconnect { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aspnet/asp-net-api-reviews @davidfowl What do I need to do to get the api-approved label on this PR? I want to merge this soon since it for 3.1.
|
/azp run AspNetCore-ci |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Co-Authored-By: Brennan <[email protected]>
a0b34d6 to
4320912
Compare
<chef-kiss.gif> ;). Excellent, thanks! |
| return true; | ||
| case HubProtocolConstants.CloseMessageType: | ||
| message = CreateCloseMessage(ref reader); | ||
| message = CreateCloseMessage(ref reader, itemCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rynowak @pranavkm @mkArtakMSFT FYI I just merged this PR into release/3.1 which changes BlazorPackHubProtocol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add "allowReconnect" to SignalR CloseMessages so the Azure SignalR Service can disconnect clients with a reason while still allowing the automatic reconnect features of the C# and TS/JS client to automatically reconnect.
For backwards compatibility, received CloseMessages with "allowReconnect" completely missing is interpreted the same as if it were false.
Compat Testing: