Skip to content

🐛 fix(desktop): prevent invalid proxy toggle saves#13850

Merged
Innei merged 5 commits into
canaryfrom
fix/proxy-form-validation-canary
Apr 16, 2026
Merged

🐛 fix(desktop): prevent invalid proxy toggle saves#13850
Innei merged 5 commits into
canaryfrom
fix/proxy-form-validation-canary

Conversation

@Innei

@Innei Innei commented Apr 15, 2026

Copy link
Copy Markdown
Member

💻 Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • ✅ test
  • 📝 docs
  • 🔨 chore

🔗 Related Issue

None.

🔀 Description of Change

  • adds renderer-side validation for desktop proxy fields before save and connection test
  • only auto-saves enableProxy when the current form state is already complete; otherwise the toggle remains an unsaved change
  • includes enableProxy in dirty-state tracking so the Save bar appears when toggle changes cannot be committed immediately
  • adds regression coverage for incomplete enable/save/test flows in the proxy settings form

🧪 How to Test

  • open Desktop Settings -> Proxy

  • toggle Enable Proxy with empty server and port fields

  • confirm the UI stays in an unsaved state instead of raising an immediate save-failed toast

  • fill a valid proxy configuration and then save or test again

  • Tested locally

  • Added/updated tests

  • No tests needed

📸 Screenshots / Videos

Before After
Enabling proxy with an incomplete form immediately triggers Save failed from networkProxy.setProxySettings. Enabling proxy with an incomplete form remains a local unsaved change until the form is complete.

📝 Additional Information

  • bunx vitest run --silent='passed-only' 'src/routes/(main)/settings/proxy/features/ProxyForm.test.tsx' could not run in this worktree because vitest.config.mts cannot resolve vite-tsconfig-paths and vitest/config.
  • bun run type-check also fails at the workspace level because this worktree does not have the required dependency/type installation; the failure is not localized to this PR.

Copilot AI review requested due to automatic review settings April 15, 2026 13:36

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@vercel

vercel Bot commented Apr 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Apr 16, 2026 3:56pm

Request Review

@sourcery-ai sourcery-ai Bot 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.

We've reviewed this pull request using the Sourcery rules engine

@codecov

codecov Bot commented Apr 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.22222% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.85%. Comparing base (843cb8f) to head (69c720b).
⚠️ Report is 38 commits behind head on canary.

Additional details and impacted files
@@            Coverage Diff             @@
##           canary   #13850      +/-   ##
==========================================
+ Coverage   66.73%   66.85%   +0.11%     
==========================================
  Files        2043     2043              
  Lines      173894   173979      +85     
  Branches    17061    17111      +50     
==========================================
+ Hits       116054   116315     +261     
+ Misses      57716    57540     -176     
  Partials      124      124              
Flag Coverage Δ
app 59.19% <92.22%> (+0.16%) ⬆️
database 92.41% <ø> (ø)
packages/agent-runtime 79.72% <ø> (ø)
packages/context-engine 83.22% <ø> (ø)
packages/conversation-flow 92.36% <ø> (ø)
packages/file-loaders 87.02% <ø> (ø)
packages/memory-user-memory 74.74% <ø> (ø)
packages/model-bank 99.86% <ø> (ø)
packages/model-runtime 84.20% <ø> (ø)
packages/prompts 69.24% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/utils 90.34% <ø> (ø)
packages/web-crawler 88.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 66.07% <ø> (ø)
Services 52.13% <ø> (ø)
Server 66.83% <ø> (-0.01%) ⬇️
Libs 52.89% <ø> (ø)
Utils 91.12% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

🚀 Desktop App Build Completed!

Version: 0.0.0-nightly.pr13850.8565
Build Time: 2026-04-16T16:26:46.308Z

📦 Release Download · 📥 Actions Artifacts

Build Artifacts

Platform File Size
macOS (Apple Silicon) LobeHub-Nightly-0.0.0-nightly.pr13850.8565-arm64-mac.zip 141.97 MB
macOS (Apple Silicon) LobeHub-Nightly-0.0.0-nightly.pr13850.8565-arm64.dmg 136.34 MB
macOS (Intel) LobeHub-Nightly-0.0.0-nightly.pr13850.8565-mac.zip 150.24 MB
macOS (Intel) LobeHub-Nightly-0.0.0-nightly.pr13850.8565-x64.dmg 143.21 MB
Windows LobeHub-Nightly-0.0.0-nightly.pr13850.8565-setup.exe 128.31 MB
Linux LobeHub-Nightly-0.0.0-nightly.pr13850.8565.AppImage 158.71 MB

Warning

Note: This is a temporary build for testing purposes only.

…olor variables

Signed-off-by: Innei <tukon479@gmail.com>
…null

CI runs with coverage instrumentation cause these form-interaction
tests to take ~4–6s each, exceeding the default 5000ms timeout.
Increase describe timeout to 10000ms and add { delay: null } to
all user.type() calls to keep them stable under coverage.
@Innei Innei merged commit 35558cb into canary Apr 16, 2026
37 checks passed
@Innei Innei deleted the fix/proxy-form-validation-canary branch April 16, 2026 16:30
mrsimpson pushed a commit to mrsimpson/lobehub that referenced this pull request May 8, 2026
* 🐛 fix(desktop): prevent invalid proxy toggle saves

* 🩹 fix: close proxy form ci gaps

* ✨ style: enhance SaveBar component with updated styles and improved color variables

Signed-off-by: Innei <tukon479@gmail.com>

* 🩹 fix(test): increase ProxyForm test timeout and add explicit delay: null

CI runs with coverage instrumentation cause these form-interaction
tests to take ~4–6s each, exceeding the default 5000ms timeout.
Increase describe timeout to 10000ms and add { delay: null } to
all user.type() calls to keep them stable under coverage.

* 🩹 fix(test): resolve ProxyForm test type errors with user-event v14

---------

Signed-off-by: Innei <tukon479@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trigger:build-desktop Trigger Desktop build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants