Skip to content

fix(THU-614): fall back to hosted proxy when native_fetch isn't compiled#1004

Open
raivieiraadriano92 wants to merge 1 commit into
mainfrom
raivieiraadriano92/thu-614-desktop-app-adding-a-custom-model-fails-with-http-plugin
Open

fix(THU-614): fall back to hosted proxy when native_fetch isn't compiled#1004
raivieiraadriano92 wants to merge 1 commit into
mainfrom
raivieiraadriano92/thu-614-desktop-app-adding-a-custom-model-fails-with-http-plugin

Conversation

@raivieiraadriano92

@raivieiraadriano92 raivieiraadriano92 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

When the desktop build doesn't ship with --features native_fetch, @tauri-apps/plugin-http isn't registered, so the "Use Native Fetch" toggle (or a stale true from a prior build) blows up with plugin http not found — adding a custom model fails connection in desktop while the web flow works.

Guard the Tauri-direct path with getCapabilities().native_fetch so 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_fetch no longer crash with "plugin http not found" when native fetch is enabled (including stale settings from an older build).

fetch.ts and createProxyFetch now check getCapabilities().native_fetch before calling @tauri-apps/plugin-http. If the plugin isn't in the build, requests fall through to the hosted proxy (or globalThis.fetch in 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.

@raivieiraadriano92 raivieiraadriano92 self-assigned this Jun 18, 2026
@raivieiraadriano92 raivieiraadriano92 added the bug Something isn't working label Jun 18, 2026
@github-actions

Copy link
Copy Markdown

Semgrep Security Scan

No security issues found.

@raivieiraadriano92 raivieiraadriano92 marked this pull request as ready for review June 18, 2026 21:18
@github-actions

Copy link
Copy Markdown

Preview environment deployed 🚀

Service URL
Marketing / blog / docs https://thunderbolt-pr-1004.preview.thunderbolt.io
App https://app-pr-1004.preview.thunderbolt.io
API https://api-pr-1004.preview.thunderbolt.io
Keycloak https://auth-pr-1004.preview.thunderbolt.io
PowerSync https://powersync-pr-1004.preview.thunderbolt.io

Stack: preview-pr-1004 · Commit: a7145f82838892cb8abae8471aa3e5490aaf8fa7

Auto-destroys on PR close/merge. Login via the bundled Keycloak realm — demo@thunderbolt.io / demo by default.

@github-actions

Copy link
Copy Markdown

PR Metrics

Metric Value
Lines changed (prod code) +27 / -6
JS bundle size (gzipped) 🟢 682.3 KB → 682.2 KB (-51 B, -0.0%)
Test coverage 🟢 78.09% → 78.08% (+-0.0%)
Performance (preview) Preview not ready — Render deploy may have timed out
Accessibility
Best Practices
SEO

Updated Thu, 18 Jun 2026 21:23:13 GMT · run #1953

@raivieiraadriano92 raivieiraadriano92 changed the title fix: fall back to hosted proxy when native_fetch isn't compiled fix(THU-614): fall back to hosted proxy when native_fetch isn't compiled Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant