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
EmandM pushed a commit that referenced this pull request Oct 27, 2026
feat: Improve error message on connection failure
EmandM added a commit that referenced this pull request Oct 30, 2026
* fix: Yamato jobs not testing built player (Backport of: #4194)

* fix: Yamato jobs not testing built player

* Next round of fixes

* Set addressables to build on players

* dotnet-fix

* Fix console tests

* Try again to remove graphics from desktop players

* Fix DA NetworkObjectDeserializationFailure test

* Remove the temporarily added N4E settings

* Fix the test failures

* Remove fix that was more a symptom than a cause (keep it simple)

* Match the deregistration to the registration logic

* Don't finish cleaning up if any scene is still loading

* Fix the U-PR config

* Fix IL2CPP player tests

* Remove CoreCLR stuff

* feat: Improve error message on connection failure [2.X] (#4208)

feat: Improve error message on connection failure

* Disabled automatic release preparation

Disabled recurring trigger as in our current situation it would be more messy to handle automated release step. I will leave it manual for now

* chore: Ensure the rerun strategy is baked into the built players (#4218)

* fix: generate canonical bools in NetworkVariable serialization tests (#4198)

* test: generate canonical bools in NetworkVariable serialization tests

RandGenBytes<bool> filled each bool with a random byte, so most values were
neither 0 nor 1. On mac arm64 IL2CPP the List<bool> and NativeHashMap<K, bool>
cases then failed with both sides printing identical all-True contents.
RandGenBool returns only false or true.

* test: use RandGenBool for the NativeArray<bool> case

* test: make changed2 always differ from original2 in collection generators

With RandGenBool an overwrite keeps the existing value half the time, so when
no elements were added or removed, changed2 could equal original2 and the
"do not match" assertions failed. Each overwrite now redraws until it differs
from the original element.

---------

Co-authored-by: Emma <emma.mcmillan@unity3d.com>
(cherry picked from commit b5c186c)

---------

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
Co-authored-by: Simon Lemay <simon.lemay@unity3d.com>
Co-authored-by: Michał Chrobot <michal.chrobot@unity3d.com>
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