Repository navigation
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces a one-way persistence migration and reworks server-startup logic affecting every existing install, and the author noted real Tauri/backend end-to-end runs were not performed, so human verification is warranted.
1 open finding
What changed in this PR
This PR fixes issue #1185, where a user's custom "Server URL" was discarded on startup/refresh. The root cause was that desktop (and web) startup unconditionally wrote the bundled/discovered server address into the store via setServerUrl, clobbering any saved custom value. The fix introduces a serverUrlSource ('auto' | 'custom') flag and a dedicated setDiscoveredServerUrl action that only applies an auto-discovered URL when the current source isn't 'custom', so user selections persist across restarts and even survive a save that happens while async startup is still pending.
Changes:
- Added
serverUrlSourcestate plussetDiscoveredServerUrl, and apersistversion bump (v1) with a conservativemigratethat only treats exact known defaults as'auto'and preserves everything else as'custom'. - Updated
App.tsxstartup paths (web and Tauri) to callsetDiscoveredServerUrlinstead ofsetServerUrl, removing the now-unusedisLoopbackVoiceboxServerUrlhelper. - Added a new Bun test suite covering persistence, migration, startup races, and cache invalidation.
| File | Description |
|---|---|
| app/src/stores/serverStore.ts | Adds source tracking, setDiscoveredServerUrl, and a versioned migration; removes isLoopbackVoiceboxServerUrl. |
| app/src/App.tsx | Switches startup URL updates to setDiscoveredServerUrl so saved custom URLs are preserved. |
| app/tests/serverStore.test.ts | New tests for URL selection, migration, startup races, and cache invalidation. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -0,0 +1,169 @@ | |||
| import { afterAll, afterEach, beforeEach, describe, expect, spyOn, test } from 'bun:test'; | |||
Use the shared QueryClient for offline requests, preserve custom server URLs through startup and migration, retain capture decode diagnostics, preserve refinement language, accept supported STT languages, and explain LuxTTS short-input errors. Adapt upstream PRs jamiepine#1208, jamiepine#1204, jamiepine#1219, jamiepine#1218, jamiepine#1198, jamiepine#1199, jamiepine#1220 and jamiepine#1180; retain remote reconnect refreshes and correctly migrate the legacy bundled port. Wait for the preview output context to resume before playing. Cancel superseded starts and release preview nodes/object URLs on replacement, completion, failure and unmount. Add CI regressions for the upstream integration and preview lifecycle. Validation: 292 frontend tests on this candidate; 414 frontend tests with the working UI changes; 53 backend tests; app/web/Tauri frontend typechecks and both frontend builds. Independent review accepted the playback change. Native first-click/autoplay, acoustic output, packaging and model quality remain unverified. Co-authored-by: vincentfranstyo <66989751+vincentfranstyo@users.noreply.github.com> Co-authored-by: maxazure <405711+maxazure@users.noreply.github.com> Co-authored-by: FelixKruger <262215022+FelixKruger@users.noreply.github.com> Co-authored-by: Tony25032 <141424750+Tony25032@users.noreply.github.com> Co-authored-by: mvoloch <274143174+mvoloch@users.noreply.github.com> Co-authored-by: Lvigentini <11659311+Lvigentini@users.noreply.github.com>

Fixes #1185.
The server URL was already persisted, but desktop startup replaced it with the bundled server address. This change distinguishes user-selected URLs from automatically discovered ones, so startup preserves saved choices, including changes made while startup is pending.
Existing settings are migrated conservatively: only exact known defaults remain automatic. Other URLs, including custom loopback addresses, are preserved. Web same-origin defaults continue to work.
Validation:
The tests cover persistence, migration, startup races, and cache invalidation using in-memory storage. A real Tauri startup and backend end-to-end test were not run.