fix: use Chromium network stack for API requests and explain fetch failures#11
Merged
Conversation
…ilures Main-process requests to da.live / api.aem.live went through Node's fetch (undici), which ignores the OS proxy/PAC configuration and certificate store. On corporate networks (proxy or TLS interception) every request failed with a bare "TypeError: fetch failed" while browsers on the same machine worked fine. - Route ContentApiClient and the preview proxy upstream fetches through Electron's net.fetch (Chromium network stack: system proxy + OS trust store). - Wrap transport failures so the error names the request and the underlying cause chain (DNS/TLS/proxy/timeout) instead of a bare "fetch failed", with a hint to check network/VPN/proxy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
🎉 This PR is included in version 1.6.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Problem
On 1.6.2 (with #10 merged), users on corporate networks now hit
Error invoking remote method 'da:list': TypeError: fetch failed— a transport-level failure, not an auth one.Two issues:
ContentApiClientand the preview proxy use Node'sfetch(undici), which ignores the macOS system proxy/PAC settings and the OS certificate store. On managed machines (mandatory proxy or TLS-intercepting appliances like Zscaler), every da.live / api.aem.live request fails while browsers on the same machine work fine.TypeError: fetch failed, with the actual cause (ENOTFOUND,ETIMEDOUT, cert validation, proxy refusal) buried inerr.cause, which was never surfaced.Changes
ContentApiClientrequests and the preview proxy's upstream fetches through Electron'snet.fetch— Chromium's network stack, which honors the system proxy/PAC configuration and the OS trust store. Wired viawithContentClientand the preview-server registry's newfetchFnpass-through; tests keep injecting fake fetches as before.ContentApiClientso the error names the request and flattens the cause chain, e.g.Network request failed: GET https://admin.da.live/list/org/repo/ — fetch failed ← getaddrinfo ENOTFOUND admin.da.live (ENOTFOUND). Check your network, VPN, or proxy connection.Testing
describeErrorChain), network-failure wrapping in the client, andfetchFnpass-through in the preview-server registrynpm run lintandnpm testgreen (203 tests); dev app boots clean🤖 Generated with Claude Code