close
Skip to content

fix SignalR http2 SkipNegotiation error#62940

Merged
BrennanConroy merged 7 commits into
dotnet:mainfrom
WeihanLi:signarl-http2
Feb 13, 2026
Merged

fix SignalR http2 SkipNegotiation error#62940
BrennanConroy merged 7 commits into
dotnet:mainfrom
WeihanLi:signarl-http2

Conversation

@WeihanLi
Copy link
Copy Markdown
Contributor

@WeihanLi WeihanLi commented Jul 26, 2025

fix SignalR http2 SkipNegotiation error

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Description

Creating HttpClient for WebSocket SkipNegotiation mode also

Fixes #59303

@github-actions github-actions Bot added the area-signalr Includes: SignalR clients and servers label Jul 26, 2025
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jul 26, 2025
@WeihanLi WeihanLi marked this pull request as ready for review July 27, 2025 03:32
Copilot AI review requested due to automatic review settings July 27, 2025 03:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where SignalR clients using HTTP/2 with SkipNegotiation mode were not properly creating an HttpClient, which caused errors. The fix ensures that HttpClient is always created regardless of the negotiation and transport settings.

  • Removes conditional logic that prevented HttpClient creation in certain scenarios
  • Ensures HttpClient is available for all transport configurations
Comments suppressed due to low confidence (1)

src/SignalR/clients/csharp/Http.Connections.Client/src/HttpConnection.cs:151

  • The removal of the conditional logic that prevented HttpClient creation in SkipNegotiation + WebSockets-only scenarios should be covered by tests to ensure this fix works correctly and prevent regression.
        _httpClient = CreateHttpClient();

@dotnet-policy-service dotnet-policy-service Bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Aug 3, 2025
@JakubTracz
Copy link
Copy Markdown

Hi, any progress in fixing this?

@WeihanLi
Copy link
Copy Markdown
Contributor Author

I verified locally, but not sure if that's the way the team wants to adopt and not sure about the test cases that should be added
@BrennanConroy could you please help suggest

Copy link
Copy Markdown
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.

Can you update the _httpClient field to be non-nullable, fix the NegotiateAsync call to not use !, and not use ? in the Dispose call?

@BekAllaev
Copy link
Copy Markdown
Contributor

@BrennanConroy BrennanConroy merged commit 6bf45a7 into dotnet:main Feb 13, 2026
25 checks passed
@dotnet-policy-service dotnet-policy-service Bot added this to the 11.0-preview2 milestone Feb 13, 2026
@WeihanLi WeihanLi deleted the signarl-http2 branch February 19, 2026 06:50
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 community-contribution Indicates that the PR has been added by a community member pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SignalR Error when connect to http2 server with SkipNegotiation

5 participants