mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-12-05 05:50:04 +08:00
e2ae9feb2adc11441ba19208cc44e5075e035651
94
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
06329c3337 |
refactor(backend): extract configuration and runtime capabilities (#8801)
* chore(clippy): scope crate lint policy Keep panic-on-error lints at application target roots and scope signal dependencies to Linux. * docs(agents): define Rust backend architecture boundaries Document which layer owns Rust capabilities, fallible inputs, background work, and crate validation. * refactor(draft): type async publication conflicts Return typed conflicts for async Draft edits. Release the lock and edit permit before converting the error, and exercise overlapping updates. * refactor(logging): use typed logger errors Expose crate-owned logger errors and preserve the underlying error sources. * refactor(subscription): extract response decoding Keep HTTP and persistence in the app. Decode response metadata and framing in the crate, and fall back when the server filename is invalid. * refactor(profile): extract profile models and index rules Move profile models and index rules into the crate, preserving serialization and returning a typed missing-profile error. * refactor(profile): separate subscription refresh and scheduling policy Separate download and scheduling policy from the subscription use case while retaining the existing write path. * refactor(subscription): decode deep links in the subscription crate * refactor(profile): extract selected node recovery rules * docs(agents): define dependencies between capability crates * refactor(task): move retry primitives into the task crate * refactor(backup): extract backup ZIP writing * refactor(subscription): keep profile writes outside proxy fallback * refactor(runtime-bundle): extract runtime bundle planning Plan provider destinations and assets in the crate. Adapt the plan to the Service wire format at the call site. * perf(runtime-bundle): share destination strings with tristr Share destination storage within bundle planning and preserve the Service wire strings and provider readback. * refactor(profile): extract script validation and execution Share the Boa validation and execution API while preserving the save-side timeout and diagnostics. * refactor(config): extract configuration renderer Render from inputs supplied by the app, reuse the script crate, and preserve the default template fast path. * refactor(proxy): extract proxy view and its use case Project the Mihomo snapshot into the existing IPC DTO and move use-case orchestration out of the command. * refactor(config): inject the profile script executor * refactor(config): centralize Mihomo YAML output * perf(runtime-bundle): read remote providers from borrowed configuration * chore(clippy): scope crate lint policy Keep panic-on-error lints at application target roots and scope signal dependencies to Linux. * docs(agents): define Rust backend architecture boundaries Document which layer owns Rust capabilities, fallible inputs, background work, and crate validation. * refactor(draft): type async publication conflicts Return typed conflicts for async Draft edits. Release the lock and edit permit before converting the error, and exercise overlapping updates. * refactor(logging): use typed logger errors Expose crate-owned logger errors and preserve the underlying error sources. * refactor(subscription): extract response decoding Keep HTTP and persistence in the app. Decode response metadata and framing in the crate, and fall back when the server filename is invalid. * refactor(profile): extract profile models and index rules Move profile models and index rules into the crate, preserving serialization and returning a typed missing-profile error. * refactor(profile): separate subscription refresh and scheduling policy Separate download and scheduling policy from the subscription use case while retaining the existing write path. * refactor(subscription): decode deep links in the subscription crate * refactor(profile): extract selected node recovery rules * docs(agents): define dependencies between capability crates * refactor(task): move retry primitives into the task crate * refactor(backup): extract backup ZIP writing * refactor(subscription): keep profile writes outside proxy fallback * fix(profile): preserve delays for future update timestamps * fix(subscription): preserve filenames from response headers and URL paths * fix(subscription): separate deep link parameters from nested URLs * refactor(profile): look up the refresh target once * refactor(subscription): pass the proxy directly to each download * refactor(profile): build companion options in one place * refactor(profile): remove companions from the deleted profile * style(profile): keep profile fields together * refactor(profile): name index operations after what they change * refactor(profile): call the core reload directly * refactor(backup): move archive validation to the restore change * refactor(config): name the runtime rendering step * refactor(config): remove the unused runtime patch API * refactor(config): accumulate profile keys and logs during rendering * refactor(config): load cached chain items directly * refactor(script): keep console state local to evaluation * refactor(proxy): read group order and scope in one pass * refactor(config): reuse sequence storage when applying profile edits * refactor(proxy): collect provider snapshots in display order * refactor(proxy): build the view from its input * refactor(runtime-bundle): share provider section order * fix(config): fill blank IPv6 fake IP ranges in TUN mode * fix(config): keep runtime field sorting stable * perf(config): reuse profile sequence storage during rendering * fix(script): check the evaluated profile entry point * fix(script): support runtime console methods during validation * perf(script): count integer digits without formatting JSON * perf(proxy): resolve unique members without building scope caches * fix(runtime-bundle): reject mixed owners of a provider path * perf(runtime-bundle): reuse the normalized destination buffer * fix(script): reject oversized names before escaping |
||
|
|
447ce3ccfb |
refactor(backend): extract profile and subscription capabilities (#8800)
* chore(clippy): scope crate lint policy Keep panic-on-error lints at application target roots and scope signal dependencies to Linux. * docs(agents): define Rust backend architecture boundaries Document which layer owns Rust capabilities, fallible inputs, background work, and crate validation. * refactor(draft): type async publication conflicts Return typed conflicts for async Draft edits. Release the lock and edit permit before converting the error, and exercise overlapping updates. * refactor(logging): use typed logger errors Expose crate-owned logger errors and preserve the underlying error sources. * refactor(subscription): extract response decoding Keep HTTP and persistence in the app. Decode response metadata and framing in the crate, and fall back when the server filename is invalid. * refactor(profile): extract profile models and index rules Move profile models and index rules into the crate, preserving serialization and returning a typed missing-profile error. * refactor(profile): separate subscription refresh and scheduling policy Separate download and scheduling policy from the subscription use case while retaining the existing write path. * refactor(subscription): decode deep links in the subscription crate * refactor(profile): extract selected node recovery rules * docs(agents): define dependencies between capability crates * refactor(task): move retry primitives into the task crate * refactor(backup): extract backup ZIP writing * refactor(subscription): keep profile writes outside proxy fallback * fix(profile): preserve delays for future update timestamps * fix(subscription): preserve filenames from response headers and URL paths * fix(subscription): separate deep link parameters from nested URLs * refactor(profile): look up the refresh target once * refactor(subscription): pass the proxy directly to each download * refactor(profile): build companion options in one place * refactor(profile): remove companions from the deleted profile * style(profile): keep profile fields together * refactor(profile): name index operations after what they change * refactor(profile): call the core reload directly * refactor(backup): move archive validation to the restore change |
||
|
|
16ef6fbc34 |
fix(i18n): resolve startup locales consistently
Prefer a supported saved language over the cache and browser locale. Align frontend alias resolution with Rust and ignore unsupported saved values when the layout mounts so they cannot overwrite the fallback. In Rust, walk borrowed prefixes instead of rebuilding strings. This preserves locale resolution and removes quadratic work on long tags. Across all 14 shipped locale IDs (equally weighted), median lookup time fell from 40.0 to 22.4 ns and heap allocations fell from 4 to 2 per lookup. A synthetic 64 KiB tag fell from 771 ms to 240 µs. |
||
|
|
39fd5e968b |
chore(deps): update cargo dependencies (#8811)
* test(draft): cover conflict wakeup and busy layer * chore(deps): update cargo dependencies --------- Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> |
||
|
|
c9223b204b |
fix(limiter): handle stale clock samples and timestamp overflow
A caller could sample the clock at 1000 ms and pause while another caller was admitted at 2000 ms. On resuming, the first caller could load the newer last_run_ms, mistake its stale sample for a clock rollback, and replace 2000 with 1000. This reopened the 100 ms period and let another check at 2000 ms pass. Load last_run_ms before sampling the clock so the stale caller's compare-exchange fails if a newer admission has changed that value. Preserve sequential clock rollback behavior and the existing atomic orderings. The period check also added the period to last_run_ms. A last admission at u64::MAX - 55 with a 56 ms period overflowed on the next check: debug builds panicked and release builds wrapped the deadline to zero, admitting a duplicate timestamp. Compare elapsed time against the period only after confirming the clock has not moved backward, which makes the subtraction safe and preserves the exact period boundary. Enable the stale-sample and overflow regressions, keep the saved Proptest seed, and add Loom coverage for advancing time and multiple stale callers plus a deterministic test at u64::MAX. |
||
|
|
929bb6a0a1 |
refactor(backend): share single-owner drivers for background tasks (#8759)
* docs(backend): define background task ownership * refactor(backend): give background operations single task owners * test(backend): remove actor migration regression cases * docs(changelog): drop backend actor migration entry * refactor(backend): extract workspace task drivers * fix(timer): omit profile identifier from panic log * docs(backend): define workspace crate boundaries * refactor(lightweight): use the task countdown driver * refactor(lightweight): name countdown callbacks * refactor(task): simplify driver startup and coalescing requests * refactor(core): bind service handoff to the sidecar generation * refactor(tun): coalesce background run state reconciliation * refactor(core): own sidecar exit resources in one session * refactor(core): remove automatic Windows service handoff * refactor(task): simplify coalescing job signals * refactor(runstate): keep operation status with service state * refactor(dns): coalesce background override synchronization * refactor(sysproxy): own the local guard under its operation lock * fix(tray): read menu settings at publication * fix(dns): retain script lock across caller cancellation * refactor(profiles): own selected node restoration in one task * refactor(timer): own subscription schedules in the scheduler * test(timer): remove the added application test * fix(service): renew provider sync retry budget on refresh |
||
|
|
876d287152 |
refactor(updater): retire the startup install UI (#8747)
* refactor(updater): retire the startup install UI * fix(updater): keep daily checks running and harden the cache path |
||
|
|
4015f37eb3 |
chore(deps): update cargo dependencies (#8705)
* chore(deps): update cargo dependencies * fix(deps): align flexi_logger with tracing-estuary --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com> |
||
|
|
3f7af9ab02 |
fix(media-unlock): avoid misleading region for Muse AI in Rule mode (#8685)
* fix(media-unlock): avoid misleading region from cloudflare trace for Muse AI Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> * chore(changelog): append missing statements - Simply express what has changed in `Changelog.md` Assisted-by: MAI Code 2 (high) Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> --------- Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> Co-authored-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> |
||
|
|
7d8fec7314 |
chore(lint): inherit workspace lints in draft and logging crates
clash-verge-draft and clash-verge-logging did not inherit [workspace.lints], so cargo's missing_lints_inheritance warned and the strict clippy set never applied to them. Inheriting the lints surfaced six errors, now fixed: - draft: drop the data lock before cloning the snapshot and before returning in with_data_modify (significant_drop_tightening) - draft: require T: Send + Sync on acquire_data_modify_permit so its future is Send (future_not_send) - draft bench: scope an allow for the runtime-init panic - logging: make Logger::new const (missing_const_for_fn) - logging: return the builder directly from generate_file_log_writer, which never failed (unnecessary_wraps) The three unused-dependency warnings that remain under --all-features are cfg artifacts, not dead deps: tauri-build is only called when the clippy feature is off, tauri-plugin-devtools is compiled out when tokio-trace is enabled alongside tauri-dev, and clash-verge-logging in clash-verge-signal is only referenced by the Linux-only body of that crate. |
||
|
|
8ca401a742 | chore(rust): upgrade to 1.100 and consolidate Clippy rules (#8636) | ||
|
|
b89d09e24e |
chore(deps): update cargo dependencies (#8630)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> |
||
|
|
39ba1e64a6 |
chore(deps): remove unused dependencies (#8559)
- Drop tauri-plugin-process: no frontend or Rust consumer; exit and restart already go through the exit_app/restart_app commands backed by AppHandle::exit/restart. Remove the registration and the unused process:allow-exit capability. - Replace the glob dev dependency with Node's built-in fs.globSync in prebuild's service permission step (Node baseline is 26.13.0). - Remove unused direct Cargo declarations: bitflags and regex (source and workspace entries), and src-tauri's criterion dev-dependency; clash-verge-draft keeps criterion for its bench. - Narrow sysinfo to the network/system features actually consumed. - Use futures::StreamExt for DelayQueue in the timer and drop the tokio-stream direct declaration (still transitively present via clash-verge-service-ipc). |
||
|
|
9fb46607b5 |
chore(deps): update cargo dependencies (#8384)
* fix(webdav): allow clearing saved configuration Close #8495 * chore(deps): update cargo dependencies * fix(ci): resolve Rust dependency update failures * chore(deps): remove unrelated changelog entries --------- Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> |
||
|
|
488f022c05 |
feat(media-unlock): add Muse AI (muse.ai) detection (#8411)
* feat(media-unlock): add Muse AI detection muse.ai redirects every region to Meta's aymh anti-bot gateway before the app loads, and a plain HTTP client cannot finish the JavaScript challenge. Report the result as a new Risky status (exit reachable, availability unverifiable) together with the exit region instead of a misleading Yes/No. Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> * style(media-unlock): apply rustfmt and biome formatting Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> * docs(changelog): Update changelog Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> --------- Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> Co-authored-by: susu-Sugar <214122492+susu-Sugar@users.noreply.github.com> Co-authored-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> |
||
|
|
5e6a696087 |
revert(tray): revert per-group latency testing (#8173)
This reverts commit
|
||
|
|
7965711945 |
chore(deps): update cargo dependencies (#8323)
* chore(deps): update cargo dependencies * chore(deps): revert dependency rfd to 0.16.0 Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> --------- Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> |
||
|
|
5b10331022 |
feat!: remove signal crate for macOS and windows (#7827)
* feat!: remove signal crate * fix: clippy * feat(signal): limit the shutdown signal crate to Linux Upstream now covers termination and session-end events on Windows and macOS, but Linux has no equivalent, so pre-shutdown cleanup there still depends on listening for SIGTERM/SIGINT/SIGHUP (#7827). Restore clash-verge-signal behind a target_os = "linux" gate instead of dropping it: the dependency lives in a linux-only target section, the crate root carries an English Linux-only rationale and compiles to nothing elsewhere, and the Windows backend is gone. register() now takes the quit flow's unit future: the latch serializes in-flight cleanups and releases after each attempt, leaving the exit-or-cancel decision to the quit flow itself. Verified with cargo check and clippy for aarch64-unknown-linux-gnu, and cargo check on the host where the crate compiles empty. |
||
|
|
6e08a77a84 |
refactor(backend): specta ipc bindings (#8195)
* refactor(ipc): generate bindings with Specta * fix(profile): project IPC inputs to consumed fields * fix(events): remove unused refresh payloads * fix(webdav): return only consumed backup metadata * fix(network): trim unused interface metadata * fix(sysinfo): return only displayed system fields * chore(knip): check generated runtime exports * fix(proxy): confirm runtime chain updates before UI changes * fix(clipboard): propagate proxy environment copy failures * refactor(dns): remove ignored runtime patch * refactor(core): trim unused upgrade response fields * refactor(ipc): avoid redundant response copies * refactor(proxy): clarify automatic proxy query naming * chore(tests): remove added IPC regression tests * refactor(ipc): enforce typed command boundaries * chore(contract): check generated bindings before push * refactor(ipc): remove unused proxy liveness payloads |
||
|
|
d6a2717fc4 |
fix(profiles): skip reloading current profile on URL import (#8092)
Co-authored-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> |
||
|
|
4337bd8575 | fix(core): clarify and localize existing core errors | ||
|
|
cb751052a4 |
feat(tray): add a per-group latency test (#8173)
* feat(tray): add a per-group latency test The tray's proxy group submenus offered no way to test a group: refreshing the delays shown there meant opening the dashboard and running a test from the proxy page. Add a "Test Latency" entry at the head of each group submenu. It measures the group through the proxy page's own view, so member resolution and provider attribution match the page exactly: provider nodes are health checked on their provider, anything else goes through the proxy delay endpoint, and members the page cannot resolve are skipped. Nested groups are therefore tested through their currently selected node, as the page does. The menu is rebuilt when the run finishes. The test URL follows the page's chain -- the group's own test URL, then the configured default, then the built-in one -- including the page's validity check, so a group with a malformed URL falls back where the page falls back. A group test started from the app rebuilds the tray as well, so the two views do not drift. Co-Authored-By: Claude <noreply@anthropic.com> * fix(tray): keep latency tests and displayed results consistent * fix(tray): isolate latency histories and preserve usable menus * fix(tray): keep settings usable when proxy reads fail * fix(tray): show selected node latency for proxy groups and display timeouts as T/O Co-authored-by: wonfen <eiwonfen@gmail.com> * fix(tray): refresh proxy latency on menu interaction --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: wonfen <eiwonfen@gmail.com> |
||
|
|
6b4d4e1551 |
feat(i18n): add Brazilian Portuguese locale (#8203)
Add the `pt` frontend and backend locale bundles, register the language in the language selector, and add a Portuguese README linked from the other READMEs. Co-authored-by: Nicolas Pastorello <opastorello@MacBookPro.pastorello.infra> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
af808a677c | chore(i18n): translate English leftovers in German locale (#8184) | ||
|
|
1575f134e0 |
chore(deps): update cargo dependencies (#7961)
* chore(deps): update cargo dependencies * build(deps): revert rfd from 0.17.2 to 0.16.0 - This also prevents Mend Renovate from auto rebase Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> * fix(nsis): include missing Nullsoft headers - Transitive macro named `RestartManager_StartSession` cannot be found during NSIS installer generation - The macro comes from "RestartManager" plugin and should be explicitly included in the `installer.nsi` file Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> --------- Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> |
||
|
|
af0f502f98 | fix(macos): silence notification when hiding window with Cmd+W | ||
|
|
9f97d938f5 |
chore(i18n): complete Turkish (tr) translations (#7969)
Translate the 174 frontend strings and 8 tray/notification strings that were still English copies in the Turkish locale. Values only; no keys changed. Co-authored-by: qwist1233-cpu <qwist1233-cpu@users.noreply.github.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
de24496fa7 |
chore(deps): update cargo dependencies (#7765)
* chore(deps): update cargo dependencies * chore(deps): Revert `rfd` to version 0.16.0 Assisted-by: vscode-copilot-chat:deepseek-flash Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> --------- Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> |
||
|
|
2f370d6490 |
refactor(log): in-place writer lifecycle and span-based core observability (#7889)
* refactor(log): migrate logging to tracing-estuary pipeline Swap flexi_logger + clash-verge-logger wiring for the tracing-estuary crate: buffered file sink with explicit panic/exit drains, live level switching, and tokio-trace/chrome-trace behind crate features. AsyncLogger moves in-house (VecDeque ring); file format and rotation stay unchanged. * fix(log): reset sidecar writer in place and re-pin service-ipc v2.6.7 Rebuilding the sidecar FileLogWriter on config changes leaked flexi's unstoppable flusher thread plus an fd each time; the writer is now flushed and reset in place, matching what the service crate does. get_clash_logs_by_service drops the CompactString conversion layer now that service-ipc v2.6.7 returns plain Vec<String>, and AsyncLogger is renamed LogRing to match. * refactor(log): span-based observability and log noise cleanup Instrument spans carry the structure flat lines never could: the core-start spine (mode, readiness/owner generations, pid, config file), proxy apply and clear routes with guard generations, service IPC sessions with refusal codes and outcomes, profile-switch terminal outcomes, subscription fetch strategies, core upgrades with per-proxy version probes, backup flows, timer tasks, config generation uids, and the startup setup flow; running-mode changes emit one guarded transition event each. ~90 hand-written noise lines are gone or demoted (entry+success pairs, polled getter echoes, phase brackets, window sub-steps, platform install chatter); errors keep their anyhow chain, operation name, and item id, and swallowed retry results surface per attempt. |
||
|
|
ee497cc65d | refactor(ipc): remove unused commands | ||
|
|
2717aaadad |
fix: media unlock checking behavior (#7778)
* fix: Gemini test * naming unlock * test type * refactor: deduplicate media unlock checks * fix: run media unlock checks individually * fix(media-unlock): satisfy clippy const lint * fix: stream media unlock test results * fix: streamline media unlock checks * fix: force HTTP/1 for media unlock checks * fix: limit concurrent media unlock checks * feat: allow concurrent media unlock item checks |
||
|
|
e15ddab542 | test: trim redundant test coverage | ||
|
|
807f9a206d | chore: trim excessive comments | ||
|
|
22947632c0 |
refactor: Rewrite and improve sysproxy logic (#7744)
* fix(cmd): preserve anyhow context in coded errors Use alternate error formatting so coded failures retain the full anyhow context chain without changing their wire format. * fix(macos): skip redundant proxy disable writes When both proxy modes are off, read macOS state first and skip networksetup if the OS is already clean. Update the guard target only after a successful write. * feat(proxy): classify system proxy failures Attach stable, actionable proxy failure codes to anyhow chains while preserving the original diagnostic causes. * feat(cmd): return structured command failures Replace encoded error strings with serializable code and detail fields, and update frontend notice consumers to handle the structured shape. * fix(scripts): use the js-yaml namespace import Import js-yaml through its ESM namespace so the i18n cleanup script can access load and dump. * feat(proxy): localize classified proxy failures Map privilege and direct-fallback codes to localized explanations, and let mapped causes outrank generic operation keys in notices. * fix(ui): bound notice text and render failure details Limit resolved notice text without truncating clipboard content, and normalize structured failures embedded in translation parameters. * feat(proxy): persist unseen proxy failures Store unresolved classified failures by code, notify the frontend when the table changes, and show each failure sequence once when a visible window can receive it. * feat(proxy): report tray and hotkey toggle failures Record classified failures from tray and hotkey proxy toggles so they appear when a visible window is available. * fix(ui): restore the proxy switch after failed toggles Refresh frontend proxy state after a failed toggle so the switch reflects the rolled-back configuration. * feat(proxy): stop the guard after repeated failures Report guard outcomes, stop after the failure threshold, and persist the classified failure for the frontend. * fix(macos): preserve proxy during service handoff Stop a sidecar being handed to the service without clearing proxy state that the new owner must inherit. * feat(macos): classify misplaced sidecar state Distinguish a refused sidecar proxy write from a machine that still needs the privileged service installed. * feat(ui): recover misplaced sidecar notices Offer a restart action for macOS proxy failures caused by a ready service while the core still runs as a sidecar. * feat(ui): install the service from proxy notices Let privilege notices install the macOS service, restart the core, and report the runtime mode that was actually reached. * feat(cmd): attach requested proxy operations Carry the requested proxy direction with structured command failures when the originating command knows it. * feat(sysproxy): drain guards before OS access Wait for the local proxy guard to stop before OS reads, service handoff, or final writes, and refuse transitions when it does not drain. * feat(sysproxy): recover partial proxy writes Use write progress to choose whether to restore the old guard or compensate with a disabled proxy state, while preserving actionable errors. * feat(sysproxy): skip already-applied proxy writes Compare macOS proxy snapshots with global, PAC, and disabled targets so matching state avoids redundant privileged writes. * feat(proxy): report background proxy failures Persist and surface classified proxy failures from lifecycle paths that have no direct caller awaiting the result. * feat(ui): move proxy recovery into a dialog Guide users through installing or switching to the service after a refused proxy write, and suppress duplicate toast reports. * fix(ui): close proxy dialog after service recovery Dismiss the recovery dialog once the core reaches service mode, even when the original proxy request remains pending. * feat(ui): retry proxy request after service recovery Replay the requested proxy direction after the core reaches service mode, while leaving incidental restores unchanged. * fix(proxy): refresh state after successful apply Publish the proxy refresh from the shared apply path after releasing the lifecycle lock, and remove the tray-specific duplicate. * feat(ui): show proxy recovery progress Display installation, restart, and proxy-apply stages while keeping the primary action spinner visible during recovery. * feat(ui): route unavailable TUN through service recovery Let the TUN switch request service recovery and restore its requested state after the core restarts in service mode. * fix(ui): avoid duplicate TUN recovery errors Roll back deferred TUN toggles without reporting an error, and publish configuration refreshes from the transaction commit path. * chore: update changelog & pinlock * fix(core): resolve platform-specific clippy warnings * fix(core): detect Windows wildcard TCP conflicts Windows permits a specific exclusive bind beside an existing non-exclusive wildcard listener. Consult the system TCP listener table so the probe reports that overlap as a conflict. |
||
|
|
5cad0f2799 | fix(i18n): complete Traditional Chinese backend strings (#7726) | ||
|
|
e7b1807fef | Improve Russian localization (#7138) | ||
|
|
a8275b20b7 | refactor: extract media unlock checker crate | ||
|
|
07a1515d8c |
feat(logging): introduce ModuleFilter with exclusion support and logging tauri_plugin_mihomo (#7637)
* feat(logging): introduce ModuleFilter with exclusion support * refactor(logging): simplify exclude check using if-let chain |
||
|
|
cefcb150c9 |
fix: core runstate review/improve (#7617)
* fix(core): reopen PAC when a start attempt never happens `save_proxy_ports` closes the PAC endpoint before it stages a candidate, because the endpoint resolves the Mixed Port through the draft layer and would otherwise answer with a port nothing is listening on. Most ways out of that function are a rejection, though: the candidate is refused and the Core keeps serving on its old ports, having never been stopped. PAC is re-derived only when the Running Mode changes, and that is exactly what did not happen — so the endpoint stayed shut for the rest of the session, and every browser on PAC silently went direct. Give `core_starting` the counterpart it was missing. `core_start_settled` re-derives PAC from the Running Mode rather than restoring a saved flag, which makes it correct on all three endings — a start that succeeded, one that was abandoned, one that failed and left the Core down — and therefore safe to run from a guard on every path. * fix(config): refuse overlapping draft transactions instead of losing an edit A layer holds exactly one draft, so a second writer's `edit_draft` overwrites the first writer's staged value in place. `DraftTransaction` nonetheless rolled back by calling `discard` on the shared layer, which discarded whatever was staged there — including a change another transaction was about to commit. The other transaction then found no draft, and `apply` on an absent draft does nothing at all. It saved the committed value, returned Ok, and its side effect had already happened: auto-launch registered with the OS while the config that describes it says otherwise, and no log line either way. "Roll back only my edit" cannot be implemented over a single slot, so enforce the exclusivity the type already assumed. Beginning a transaction claims every layer and refuses rather than interleaving, which is the same shape as `try_start_config_update` and `begin_operation` elsewhere. `patch_verge` is the caller that matters: it holds its draft across `process_terminated_flags`, which restarts the Core and can take seconds. The TUN reconciliation runs on every Run State transition and can now lose that race, so it treats a busy layer as "later" rather than as a failure worth telling the user about. * fix(core): reconcile TUN availability when the setting itself changes Moving the TUN availability guard from the frontend into Rust also moved what triggers it. The old effect depended on `enable_tun_mode`; the new reconciliation is spawned from `RealEnv::publish`, so it only runs on a Run State transition. Those two sets are not the same, and the setting itself falls in the gap. Switching TUN on from the global hotkey is the case that reaches it. That path is not gated on availability — unlike the tray item and the settings switch, both of which read `tun_capable` — and the flags a TUN patch raises are answered by a Core reload, which changes no Run State at all. So on a machine with no Service and no elevation the setting stayed on: tray icon, settings switch and `enable_tun_mode` in verge.yaml all reported TUN as enabled while nothing carried its traffic, until some unrelated core lifecycle transition happened to reconcile it. Reconcile after any patch that touched the setting. The reconciliation writes configuration itself, so it goes through the plain apply rather than back through the patch-and-reconcile form; the absence of a cycle is then a property of the call graph rather than of a runtime early-return. `toggle_tun_mode` now reads the setting back instead of returning what it asked for, so the hotkey cannot report TUN as on moments before the notice saying it was turned off. * fix(core): an action already under way is not a decision to put to the user The legacy status could not distinguish a requested privileged operation from one already running, because readers blocked until the operation finished and so never observed the request at all. Run State pushes every transition instead, and `service_needs_attention` treated any pending action as a question for the user. So an install started from the settings page or the home card raised the migration dialog on top of it, and an uninstall raised one offering to reinstall the Service being removed. Both offer a button that can only fail, since the privileged-operation slot is already taken. An operation in flight is a report of progress. The dialog the user is already driving keeps itself open through its own loading state. `tun_should_be_disabled` is unaffected: it already refused to act while an operation was in flight, so the term this adds is redundant there. * fix(core): let the snapshot decide whether the Run State has settled `settled` read the operation slot twice: once to decide whether to wait, then again inside the snapshot it returned. An operation claiming the slot between those two reads was described rather than waited for. `prepare_startup` reads this. A start racing an install would see the requested install, flatten it to `InstallRequired`, and decide `Wait` — leaving the core stopped where waiting for the install to finish would have told it whether the Service came back. Read the slot once, inside the snapshot, so there is no window rather than a second check closing it. The rewrite that introduced this also fixed a lost wakeup here, and that fix stands: the waiter is still registered before the state is read. * fix(ui): re-read the Run State once its listener is live Replacing the poll with a push left a gap. `listen` resolves asynchronously, so between the first `get_runtime_state` and the subscription being registered there is a window, and a transition landing in it is not queued anywhere — it is simply missed. The next event is whenever the backend happens to move again, which during startup can be a long time; the 30-second safety net was all that stood behind it, where the old code polled every two seconds precisely through startup. The Run State is the one thing here that arrives only by event, so it is the one thing a missed event leaves stale. Re-read it once every listener is live, which closes the gap without going back to polling for it. `onSubscribed` fires even when a registration failed, because a resync is most needed when a subscription is missing, and not at all after teardown. * docs(config): state what makes the PAC endpoint's draft read safe `MixedPort::desired` reads the draft layer, so the PAC endpoint can name a port the Core has not moved to yet. That is only safe because the one path staging a listener port closes PAC across the change. Nothing said so at either end, and the two are in different modules. * fix(core): ask again when staging goes silent rather than assume it failed The Service commits the generation before it answers, so a reply that never arrives is not evidence that nothing was written: config.yaml can already hold the new configuration while this side concludes the staging never happened. The Core keeps running the previous configuration, so nothing looks wrong -- until the Core dies and the Service's watchdog restarts it in the same generation from whatever config.yaml says, quietly making live a configuration the app reported as failed. Silence is the one answer that has to be resolved rather than acted on, so ask once more before falling back. It is cheap exactly where it matters: staging plans against the manifest it wrote, so a bundle that already landed copies nothing and answers in milliseconds, and the Service's lifecycle lock makes a second ask wait for a first one still in flight instead of interleaving with it. A deadline keeps that wait off the caller, and a second silence goes where the first one used to. |
||
|
|
dca6fdcae6 |
chore(deps): update cargo dependencies (#7443)
* chore(deps): update cargo dependencies * fix(deps): align shared Rust dependency versions --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com> |
||
|
|
c90de1355e |
refactor: core runstate (#7602)
* refactor(core): introduce core::runstate as the owner of Run State
"Is the Service available?" had five caches and three predicates, and
prepare_startup consulted all three within thirty lines. This lands the
foundation for collapsing that, with no behaviour change: the old owners
now delegate into one store.
The state model splits observation from intent. Five of ServiceStatus's
ten variants were never observations — cmd/service.rs passed
ServiceStatus::InstallRequired as the "which operation do you want"
argument — which is why narrowing to ServiceInstallState had to be lossy.
ServiceHealth now records what we saw, PendingAction records what the
session asked for, and ServiceStatus::from_run_state flattens the pair
for call sites that still expect the single slot.
Reads differ only in freshness: state() is cached, settled() waits for an
in-flight privileged operation, probe() forces IPC. What an answer means
lives on the snapshot (service_usable, tun_capable), so callers stop
writing their own formulas — the tray now asks tun_capable() instead of
recomputing "admin or ready".
Effects sit behind RunStateEnv with two adapters, RealEnv and FakeEnv.
That retires the seven tests that hand-built a private ServiceManager
struct literal, and makes the probe and detection paths testable for the
first time.
Two distinctions are now explicit rather than incidental:
- A single failed probe is not an observation and leaves confirmed
health intact; exhausting a poll's whole retry budget is one and
records unavailable. Both are tested, protecting
|
||
|
|
df66d976a5 |
feat(updater): skip installer language prompt during auto-update (#7572)
* feat(updater): skip installer language prompt during auto-update * fix: Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> |
||
|
|
23dda47641 |
feat: add launch guard and secure multi-user service ownership (#7569)
* feat(service): isolate macOS launch and owner runtime * ci(windows): run owner security tests * chore(deps): use kode-bridge v0.4.1 tag * fix(macos): classify installed service state * fix(macos): classify marked unavailable service * fix(macos): gate core startup on service migration * fix(macos): scope service init to supported platforms * feat(macos): prompt before migrating installed service * fix(macos): shorten sidecar IPC path * build(service): pin helper protocol and artifacts * fix(core): require confirmed service and sidecar readiness * fix(macos): harden launch roots and singleton state * fix(ui): refresh migration state before restart * fix(macos): linearize service migration lifecycle * fix(ui): keep service migration state fresh * feat(service): track authenticated owner sessions * fix(service): preserve newer owner sessions * feat(macos): route service proxy changes through helper * fix(macos): serialize service proxy guard * fix(macos): close service proxy owner lifecycle * fix(macos): close remaining proxy stop races * fix(app): do not cancel controlled service stop * fix(lifecycle): keep controlled updates cancellation-safe * fix(macos): stage dev core for service * test(macos): exercise staged core cleanup * fix(dev): await controlled macOS exit * chore: update changelog * fix(macos): recover sidecar after service install failure Allow the existing sidecar to continue when service installation leaves the manager in InstallRequired, then settle the session state as SidecarAllowed. Show neutral status text while the migration dialog waits for its final state. * fix(macos): stage dev service tools before elevation * fix(macos): localize launch guard prompts * fix(service): address cross-platform integration issues * feat: support seamless service migration * fix: pass Windows service installer path safely * fix(prebuild): derive service release from Cargo dependency * fix(dev): preserve service installation state * fix: resolve clippy warnings in service lifecycle |
||
|
|
f6440175d8 | fix(signal): use default runtime (#7495) | ||
|
|
1d3a7107d9 |
chore(deps): update cargo dependencies (#7332)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> |
||
|
|
1e44bafa79 |
fix(service): notify users about macOS App Translocation
Show a delayed localized error notice when Clash Verge is running from a translocated temporary path and no stable core path can be resolved. |
||
|
|
462d9f536d |
chore(deps): update cargo dependencies (#7141)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> |
||
|
|
fa27d3eae5 |
Revert "feat(cvd): add device-bound subscription protocol"
This reverts commit
|
||
|
|
2cb9c13ab6 | feat(cvd): add device-bound subscription protocol | ||
|
|
232be33754 | fix(draft): serialize async updates |