Add a lifecycle lock around core start, stop, restart, and service handoff
paths. Make start_core idempotent, skip startup while exiting, and roll
back running mode after startup failures so later retries are not blocked.
Wait longer for slow Windows service startup, then hand off from sidecar
to service when it becomes ready. Retry service core startup during the
handoff window, and clean up root-owned macOS service core/IPC leftovers
before uninstalling the service.
Pulls in the plugin's response-deserialization tolerance, connection-pool permit fix, single reqwest::Client reuse, and WebSocket secret encoding/redaction (cf97ff9).
Recover from controller read/switch failures on the mode card instead of
showing a bare "communication error":
- fall back to the tolerant get_clash_mode command (then runtime config)
when the live /configs mode is unavailable,
- optimistically reflect the clicked mode and write it through to the
getClashConfig cache so a failed refetch can't flash back the old value,
- surface patch failures via showNotice on both the home card and the
proxies page (patchClashMode can now reject), and
- revalidate getClashMode/getRuntimeConfig on refresh-clash-config so a
once-empty fallback can recover.
The home mode card read the proxy mode only from mihomo's /configs (strict
BaseConfig); when that response drifted a single field, the whole read
failed and the card showed a bare "communication error". patch_clash_mode
also swallowed backend PATCH failures and always returned Ok, so the UI
could not tell a switch had actually failed.
- add a tolerant get_clash_mode command that reads mode from the saved
clash config (IClashTemp::get_mode), bypassing strict BaseConfig
deserialization, and
- make change_clash_mode return Result and have patch_clash_mode propagate
it; the hotkey/tray callers log-and-ignore as before.
* fix: wrap v2ray-plugin JSON.parse in try-catch to prevent crash on malformed URIs
A malformed ss:// URI with invalid base64-encoded v2ray-plugin query
parameter causes an unhandled JSON.parse exception that crashes the
profile import flow. This matches the error handling pattern already
used in vless.ts and vmess.ts.
* fix: format JSON.parse and sort callback to satisfy biome
* fix: improve type safety and remove redundant type casts
- Fix @@ts-expect-error typo (double @) in traffic-diagnostics.ts
- Replace (e.target as any) with (e.target as HTMLElement) in setting-clash.tsx
- Remove redundant (onFormat as any) cast in guard-state.tsx
* fix: format api.ts sort callback to satisfy biome
* fix: remove as any, let @ts-expect-error suppress the non-standard API error
* fix: remove invalid @@ts-expect-error comment, keep as any for non-standard API