Repository navigation
feat: Improve error message on connection failure - #4207
simon-lemay-unity wants to merge 4 commits into
Conversation
| { | ||
| 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) |
There was a problem hiding this comment.
Encrypted WebGL clients with UseWebSockets=false receive advice to switch to WebSockets even though WebSockets are already active. In WebGL player builds, CreateDriver selects WebSocketNetworkInterface even when m_UseWebSockets is false. LogClientConnectionFailureMessage instead checks the serialized flag, so it incorrectly suggests that DTLS is involved. Determine whether WebSockets are effectively enabled, including the WebGL fallback. Use that result in both WebSocket checks in LogClientConnectionFailureMessage.
🤖 Helpful? 👍/👎
There was a problem hiding this comment.
You get a warning in the console when we end up using WebSockets even if UseWebSockets is false. It's not something that's supposed to happen on a correctly configured transport so I don't think it's worth handling here.
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## develop-3.x.x #4207 +/- ##
=================================================
- Coverage 76.03% 76.01% -0.03%
=================================================
Files 159 159
Lines 27344 27371 +27
=================================================
+ Hits 20791 20805 +14
- Misses 6553 6566 +13
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Purpose of this PR
Clients would previously just log "failed to connect to server" on a connection failure. While perfectly accurate, it's not particularly useful. This PR adds possible reasons for the connection failure, based on the transport configuration. The list of reasons is what I've observed most often on our forums, Discord, and customer tickets.
Jira ticket
UUM-155178
Changelog
Didn't think it was worth updating.
Documentation
Testing & QA
Functional Testing
Manual testing :
Manual testing doneAutomated tests:
Covered by existing automated testsCovered by new automated testsDoes the change require QA team to:
Review automated tests?Execute manual tests?Provide feedback about the PR?Up-port
N/A
Backports
#4208