fix(THU-614): fall back to hosted proxy when native_fetch isn't compiled#1004
Open
raivieiraadriano92 wants to merge 1 commit into
Conversation
Semgrep Security ScanNo security issues found. |
|
Preview environment deployed 🚀
Stack: Auto-destroys on PR close/merge. Login via the bundled Keycloak realm — |
PR Metrics
Updated Thu, 18 Jun 2026 21:23:13 GMT · run #1953 |
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.
When the desktop build doesn't ship with
--features native_fetch,@tauri-apps/plugin-httpisn't registered, so the "Use Native Fetch" toggle (or a staletruefrom a prior build) blows up withplugin http not found— adding a custom model fails connection in desktop while the web flow works.Guard the Tauri-direct path with
getCapabilities().native_fetchso builds without the capability silently fall through to the hosted proxy (THU-467 Universal Proxy), which is the canonical path anyway. Tests added for both branches.Fixes THU-614.
Note
Low Risk
Narrows when the Tauri HTTP plugin runs; default behavior becomes safer fallback to the existing hosted proxy path with no auth or data-model changes.
Overview
Desktop builds without
--features native_fetchno longer crash with "plugin http not found" when native fetch is enabled (including stale settings from an older build).fetch.tsandcreateProxyFetchnow checkgetCapabilities().native_fetchbefore calling@tauri-apps/plugin-http. If the plugin isn't in the build, requests fall through to the hosted proxy (orglobalThis.fetchin the dev toggle path) instead of invoking the missing plugin.Tests cover both branches: Tauri-direct when the capability is present, and hosted proxy when it isn't.
Reviewed by Cursor Bugbot for commit a7145f8. Bugbot is set up for automated code reviews on this repo. Configure here.