Skip to content

feat: Improve error message on connection failure [2.X] - #4208

Merged
simon-lemay-unity merged 1 commit into
develop-2.0.0from
2.x/fix/improve-failed-connect-error
Oct 23, 2026
Merged

simon-lemay-unity merged 1 commit into
develop-2.0.0from
2.x/fix/improve-failed-connect-error

Conversation

@simon-lemay-unity

Copy link
Copy Markdown
Contributor

Purpose of this PR

Backport of PR #4207.

Jira ticket

UUM-155178

Changelog

Didn't think it was worth updating.

Documentation

  • No documentation changes or additions were necessary.

Testing & QA

Functional Testing

Manual testing :

  • Manual testing done

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does the change require QA team to:

  • Review automated tests?
  • Execute manual tests?
  • Provide feedback about the PR?

Up-port

#4207

Backports

N/A

@simon-lemay-unity
simon-lemay-unity requested a review from a team as a code owner October 22, 2026 15:40

@u-pr u-pr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Harness Review

LGTM

The change expands connection-failure guidance while preserving the existing disconnect flow and adapting the timeout test to the longer message.

Reviewed commit e03fe07

🤖 Helpful? 👍/👎

{
reasons.Add($"Server/host might not be reachable. Try \"ping {ConnectionData.Address}\" in a terminal.");
reasons.Add("The firewall on the server/host might be blocking the connection attempts.");
if (m_UseEncryption && !m_UseWebSockets)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2

In browser builds with UseWebSockets false and UseEncryption true, failed direct connections incorrectly report DTLS as a possible cause. CreateDriver forces WebSocketNetworkInterface under UNITY_WEBGL && !UNITY_EDITOR, even when UseWebSockets is false. The connection therefore uses TLS over WebSockets, and recommending WebSockets sends users toward a protocol already in use. The Relay diagnostic has the same flag mismatch. Base these conditions on the effective protocol, including the WebGL fallback.

🤖 Helpful? 👍/👎

@codecov-github-com

codecov-github-com Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 53.57143% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...meobjects/Runtime/Transports/UTP/UnityTransport.cs 53.57% 13 Missing ⚠️
@@                Coverage Diff                @@
##           develop-2.0.0    #4208      +/-   ##
=================================================
- Coverage          74.20%   74.18%   -0.03%     
=================================================
  Files                172      172              
  Lines              28200    28227      +27     
=================================================
+ Hits               20926    20940      +14     
- Misses              7274     7287      +13     
Flag Coverage Δ
NGOv2_project_testproject_ubuntu 73.77% <53.57%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...meobjects/Runtime/Transports/UTP/UnityTransport.cs 76.12% <53.57%> (-0.81%) ⬇️
Components Coverage Δ
com.unity.netcode.gameobjects 74.18% <53.57%> (-0.03%) ⬇️

ℹ️ Need help interpreting these results?

@simon-lemay-unity
simon-lemay-unity merged commit 183cbc8 into develop-2.0.0 Oct 23, 2026
25 of 26 checks passed
@simon-lemay-unity
simon-lemay-unity deleted the 2.x/fix/improve-failed-connect-error branch October 23, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants