Skip to content

fix(profiles): save local voices without internet connectivity - #2901

Merged
velixio merged 8 commits into
mainfrom
fix/offline-profile-connectivity
Oct 15, 2026
Merged

velixio merged 8 commits into
mainfrom
fix/offline-profile-connectivity

Conversation

@velixio

@velixio velixio commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Saving a cloned voice can pause before POST /profiles when internet disconnects, even though the local backend is healthy. Let supervisor readiness govern local desktop API availability while remote backends also require browser connectivity. This closes a separate frontend gap from #2583's backend/model-loading fixes.

Changes

  • Replace TanStack Query's browser connectivity listener with a supervisor-aware policy: local saves ignore internet events; remote saves also require browser connectivity.
  • Preserve startup/crash pausing, ready/unresponsive availability, remote save queuing/reconnection, and browser-only connectivity handling.
  • Add regressions for local mutation execution after disconnect and for reconnect events during startup or crashes.
  • Document offline profile saves in electron/README.md and CHANGELOG.md.

Type

  • 🐛 Bug fix

Testing

  • Local offline saves and premature reconnect regressions fail before the original fix. Three remote-backend regressions fail before the review follow-up; all pass afterward.
  • All 48 targeted Vitest tests pass across backend status, profile operations, and reference transcription.
  • Electron main/renderer TypeScript checks, formatting, and git diff --check pass.
  • Full backend/frontend CI and Linux, Windows, macOS Apple Silicon and macOS Intel smoke tests pass. A live disconnected-network installer test has not been performed.

Checklist

  • I've tested this locally
  • Every commit author has signed the CLA (CLA check passes)
  • I've updated relevant documentation
  • No local machine paths, logs, or personal env details in this PR
  • Maintained version files are in sync (no version bump)
  • Runtime regression fixture passes platform smoke-matrix checks (Linux, Windows, macOS Apple Silicon and macOS Intel)

Release cadence

Continuous-to-main; no version bump or release publication. The change becomes part of rolling main and Docker latest after merge; desktop release publication follows the release checklist.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: debpalash/VoiceStudio/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e1b7ab8-e22c-47f8-8c89-3295e7b2ecc9
📥 Commits

Reviewing files that changed from the base of the PR and between e0e4dad and b6e29b0.

📒 Files selected for processing: 3
  • electron/README.md
  • electron/src/renderer/src/hooks/use-backend-status.test.ts
  • electron/src/renderer/src/hooks/use-backend-status.ts
🚧 Files skipped from review as they are similar to previous changes: 1
  • electron/README.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

📝 Walkthrough

The backend-status hook now combines backend reachability with browser connectivity to set React Query availability. Tests cover local and remote mutations across connectivity states. The README describes offline profile saves after setup and model installation.

Changes: Desktop backend connectivity

Layer / File(s) Summary
Request availability and connectivity coverage
electron/src/renderer/src/hooks/use-backend-status.ts, electron/src/renderer/src/hooks/use-backend-status.test.ts, electron/README.md
The hook combines backend reachability with browser connectivity for remote requests and updates React Query availability as those states change. Tests cover local and remote mutations, startup and failure states, and backend switching. The README describes offline profile saves after setup and model installation.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Suggested reviewers: debpalash

Merge Risk: ⚪ Minimal · up to b6e29

Local requests remain available when the backend is reachable without internet connectivity, while remote requests wait for connectivity. No identified issue blocks merging after normal checks.

Pre-merge checks: Passed 8 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 8 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Cross-Platform Default Parity Passed No platform-divergent default is introduced. The changed renderer logic branches only on backend reachability, remote mode, and browser connectivity; it has no macOS, Windows, or Linux branch. The com…
I18n Completeness (21 Locales) Passed No new or changed t('...') keys appear in the Electron UI diff. The changed hook contains connectivity logic only, and the added strings are test names/data, not user-facing UI. No hardcoded user-fa…
Local-First Guarantee Passed PASS — The PR changes only backend connectivity state handling, tests, and Electron documentation. use-backend-status.ts:42-80 listens for browser events and updates TanStack Query state; it adds no…
Backward Compatibility Passed The pull request changes only Electron connectivity handling, tests, and README text. The authoritative diff contains no database schema, Alembic migration, voice/project/settings data, engine install…
Title check Passed The title uses Conventional Commit format with the scope profiles and accurately describes the local voice save fix. The body includes issue reference #2583.
Description check Passed The description includes all required sections, identifies the bug fix, documents changes and testing, and completes the checklist. It also states that no version bump is planned.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no blocking issue remains.

Summary

Local desktop requests now follow backend readiness without waiting for internet access.

  • Local profile saves keep working when the internet drops.

Reviews (7) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

Comment thread electron/src/renderer/src/hooks/use-backend-status.ts Outdated

@BichengWang BichengWang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed a10f350a34831371d0be9a5a575a4143d17a6117 against 06537266551c0174ec8f62d05eb1dfef8bca8317; no blocking correctness findings in this scope.

I reproduced both local-save cases (ready and unresponsive) stalling after an offline event with the base hook, plus an online event incorrectly bypassing startup gating. All three regressions fail against the base implementation and pass at this head. I substituted only the base hook through a temporary Vite transform, keeping the PR tests and dependencies identical.

The earlier remote-connectivity finding is addressed: remote saves remain queued while disconnected, a pushed ready status cannot override that disconnection, and reconnecting during a crash does not resume work. Switching back to a local backend while offline also restores availability. The supervisor supplies remote from its active connection, and the shared reachability helper still permits a live-but-busy backend.

Validation: 69 tests pass across backend status, profile hooks, reference transcription, backend gating, and clone profile saving; Electron main/renderer TypeScript checks pass. Tests ran with Node 24, HF_HUB_OFFLINE=1, and an empty HF cache. The default local Node 26 run hit a jsdom/localStorage incompatibility in profile tests; rerunning on Node 24 resolved it without source changes.

This validates renderer policy and mocked transport behavior; I did not disconnect a packaged desktop app or run Windows/Linux installers. The upstream backend/frontend CI job is still pending, so this review does not establish merge readiness.

@velixio
velixio merged commit 92ddc32 into main Oct 15, 2026
22 checks passed
@velixio
velixio deleted the fix/offline-profile-connectivity branch October 15, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants