Skip to content

Conversation

@halter73
Copy link
Member

@halter73 halter73 commented Oct 11, 2019

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:

  • Tested 3.0 JS Client receiving close message with this new flag from 3.1 Server with JSON protocol
  • Tested 3.0 JS Client receiving close message with this new flag from 3.1 Server with MessagePack protocol
  • Tested 3.0 .NET Client receiving close message with this new flag from 3.1 Server with JSON protocol
  • Tested 3.0 .NET Client receiving close message with this new flag from 3.1 Server with MessagePack protocol
  • Tested 3.1 JS Client receiving close message without this new flag from 3.0 Server with MessagePack protocol
  • Tested 3.1 .NET Client receiving close message without this new flag from 3.0 Server with MessagePack protocol

@halter73 halter73 added the area-signalr Includes: SignalR clients and servers label Oct 11, 2019
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; } }
Copy link
Member Author

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

@analogrelay analogrelay added this to the 3.1.0-preview1 milestone Oct 11, 2019
@analogrelay
Copy link
Contributor

As a reminder: Do not merge until I post back indicating we have approval from the release QB

@analogrelay analogrelay added the api-ready-for-review API is ready for formal API review - https://github.com/dotnet/apireviews label Oct 11, 2019
Copy link
Member

@BrennanConroy BrennanConroy left a comment

Choose a reason for hiding this comment

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

{
reader.Read();

return reader.TokenType switch
Copy link
Member

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

@halter73 halter73 force-pushed the halter73/closemessage-3.1 branch from aad9b2a to b4c3a38 Compare October 15, 2019 02:32
@analogrelay analogrelay added the * NO MERGE * Do not merge this PR as long as this label is present. label Oct 15, 2019
@analogrelay
Copy link
Contributor

analogrelay commented Oct 15, 2019

I put the "NO MERGE" label on just to make clear that we're pending approval for 3.1.

@halter73 halter73 force-pushed the halter73/closemessage-3.1 branch from b4c3a38 to 1f00a16 Compare October 15, 2019 18:47
@analogrelay
Copy link
Contributor

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/

@analogrelay analogrelay added Servicing-approved Shiproom has approved the issue and removed * NO MERGE * Do not merge this PR as long as this label is present. labels Oct 15, 2019
@halter73 halter73 force-pushed the halter73/closemessage-3.1 branch from 1f00a16 to a0b34d6 Compare October 16, 2019 01:08
Copy link
Member

@BrennanConroy BrennanConroy left a 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.

@halter73
Copy link
Member Author

/azp run AspNetCore-ci

@azure-pipelines
Copy link

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; } }
Copy link
Member Author

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.

@halter73
Copy link
Member Author

/azp run AspNetCore-ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@halter73 halter73 force-pushed the halter73/closemessage-3.1 branch from a0b34d6 to 4320912 Compare October 16, 2019 22:44
@analogrelay
Copy link
Contributor

Compat Testing:

<chef-kiss.gif> ;). Excellent, thanks!

@davidfowl davidfowl added api-approved API was approved in API review, it can be implemented and removed api-ready-for-review API is ready for formal API review - https://github.com/dotnet/apireviews labels Oct 17, 2019
@halter73 halter73 merged commit a4af618 into release/3.1 Oct 17, 2019
@halter73 halter73 deleted the halter73/closemessage-3.1 branch October 17, 2019 20:31
return true;
case HubProtocolConstants.CloseMessageType:
message = CreateCloseMessage(ref reader);
message = CreateCloseMessage(ref reader, itemCount);
Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oof, probably should've gotten sign off from @pranavkm before the merge. Next time :). Can you take a quick look @pranavkm and see if this seems problematic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-approved API was approved in API review, it can be implemented area-signalr Includes: SignalR clients and servers Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants