Skip to content

Conversation

@BrennanConroy
Copy link
Member

Description

Using .shouldSkipNegotiate(true) with the SignalR Java client will null ref.

Customer Impact

Can't use the skip negotiate feature, useful for environments where you can't/wont enable sticky sessions, and/or always know WebSockets will be used.

Regression?

  • Yes
  • No

Regressed from 3.1

Risk

  • High
  • Medium
  • Low

The issue is very obvious, the reason it wasn't found during the 5.0 release is because of an unfortunate piece of the testing that hid the issue. Fixed by writing a new test.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

Addresses #29765

@BrennanConroy BrennanConroy added Servicing-consider Shiproom approval is required for the issue area-signalr Includes: SignalR clients and servers feature-client-java Related to the SignalR Java client labels Feb 26, 2021
@BrennanConroy BrennanConroy added this to the 5.0.x milestone Feb 26, 2021
@ghost
Copy link

ghost commented Feb 26, 2021

Hello human! Please make sure you've included the Shiproom Template in a comment or (preferably) the PR description. Also, make sure this PR is not marked as a draft and is ready-to-merge.

TransportEnum chosenTransport;
if (this.skipNegotiate) {
if (this.transportEnum != TransportEnum.WEBSOCKETS) {
throw new RuntimeException("Negotiation can only be skipped when using the WebSocket transport directly.");
Copy link
Member

Choose a reason for hiding this comment

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

I think we could make it a bit more clear in the doc comments that the transport must explicitly be set to {@link TransportEnum.WEBSOCKETS} rather than it being something that happens automatically when you call .shouldSkipNegotiate(true).

/**
* Indicates to the {@link HubConnection} that it should skip the negotiate process.
* Note: This option only works with the Websockets transport and the Azure SignalR Service require the negotiate step.
*
* @param skipNegotiate Boolean indicating if the {@link HubConnection} should skip the negotiate step.
* @return This instance of the HttpHubConnectionBuilder.
*/
public HttpHubConnectionBuilder shouldSkipNegotiate(boolean skipNegotiate) {

Copy link
Member Author

Choose a reason for hiding this comment

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

Let this ruminate over the weekend, and I'm going to remove this check from the 5.0 change and add it to the main branch.
This would break folks who didn't set a transport and it would use WebSockets first by default but now would throw.

@leecow leecow added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Mar 2, 2021
@leecow leecow modified the milestones: 5.0.x, 5.0.4, 5.0.5 Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-signalr Includes: SignalR clients and servers feature-client-java Related to the SignalR Java client Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants