Skip to content

Conversation

WeihanLi
Copy link
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 Copilot AI review requested due to automatic review settings July 27, 2025 03:32
Copy link
Contributor

@Copilot 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();

Copy link
Contributor

Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime.
To make sure no conflicting changes have occurred, please rerun validation before merging. You can do this by leaving an /azp run comment here (requires commit rights), or by simply closing and reopening.

@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
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
1 participant