fix: use multi-endpoint connectivity check to support China/GFW users#13474
Closed
christian-byrne wants to merge 2 commits intomasterfrom
Closed
fix: use multi-endpoint connectivity check to support China/GFW users#13474christian-byrne wants to merge 2 commits intomasterfrom
christian-byrne wants to merge 2 commits intomasterfrom
Conversation
The _diagnose_connectivity() function previously only probed google.com to determine whether the user has internet access. Since google.com is blocked by China's Great Firewall, Chinese users were always misdiagnosed as having no internet, causing misleading LocalNetworkError messages. Now checks the Comfy API health endpoint first (the most relevant signal), then falls back to multiple probe URLs (google.com, baidu.com, captive.apple.com) to support users in regions where specific sites are blocked.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Created by the Glary-Bot Agent
Summary
_diagnose_connectivity()which previously only probedgoogle.comto detect internet access — blocked by China's Great Firewall, causing every Chinese user to be misdiagnosed as having no internetgoogle.com,baidu.com,captive.apple.com)Context
Users in China report
LocalNetworkError: Unable to connect to the networkwhen using API nodes (Grok, VertexAI/Gemini). After retries are exhausted,_diagnose_connectivity()pingsgoogle.comto determine if the issue is local or server-side. Since Google is blocked in China, every Chinese user gets the misleading "check your internet" message.Changes
comfy_api_nodes/util/client.py:/healthendpoint first — if reachable, returns immediatelygoogle.com,baidu.com,captive.apple.comtests/test_diagnose_connectivity.py— 7 regression tests covering: API healthy fast-path, Google blocked (China), baidu fallback, all probes fail, API 500, captive Apple fallbackVerification
Backend Python utility — no browser testing applicable. All 7 unit tests pass. No new LSP diagnostics.
API Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms