diff --git a/Cargo.lock b/Cargo.lock
index c41e9101d..25ef4c61d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1124,6 +1124,7 @@ dependencies = [
"rfd 0.18.0",
"runas",
"rustls",
+ "semver 1.0.28",
"serde",
"serde_json",
"serde_yaml_ng",
diff --git a/package.json b/package.json
index c401adfdb..fcea7184e 100644
--- a/package.json
+++ b/package.json
@@ -56,7 +56,6 @@
"@tauri-apps/plugin-updater": "2.14.1",
"ahooks": "^3.10.0",
"cidr-block": "^2.3.0",
- "compare-versions": "^6.1.1",
"dayjs": "1.11.23",
"foxact": "^0.3.12",
"foxts": "^5.9.1",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ed31c0489..019edc0ae 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -245,9 +245,6 @@ importers:
cidr-block:
specifier: ^2.3.0
version: 2.3.0
- compare-versions:
- specifier: ^6.1.1
- version: 6.1.1
dayjs:
specifier: 1.11.23
version: 1.11.23
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index b3a2551d8..ac928e0c6 100755
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -64,6 +64,7 @@ chrono = { workspace = true }
boa_engine = "0.22.0"
http-body-util = "0.1.5"
percent-encoding = "2.3.2"
+semver = "1.0"
reqwest = { workspace = true }
sysproxy = { git = "https://github.com/clash-verge-rev/sysproxy-rs.git", rev = "2c9d0a538052aac6e44ad413156a6e848da262b9", version = "0.7.2", features = [
"guard",
diff --git a/src-tauri/src/core/notify/mod.rs b/src-tauri/src/core/notify/mod.rs
index 9a6b7699f..581394494 100644
--- a/src-tauri/src/core/notify/mod.rs
+++ b/src-tauri/src/core/notify/mod.rs
@@ -6,8 +6,6 @@ pub mod notification;
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, specta::Type)]
pub enum NoticeStatus {
- #[serde(rename = "info")]
- Info,
#[serde(rename = "import_sub_url::ok")]
ImportSubUrlOk,
#[serde(rename = "import_sub_url::error")]
@@ -83,8 +81,7 @@ impl NoticeStatus {
/// test both derive their variant list from here; expected strings stay
/// hand-written in the test so renames cannot slip through.
#[cfg(test)]
- pub const ALL: [Self; 34] = [
- Self::Info,
+ pub const ALL: [Self; 33] = [
Self::ImportSubUrlOk,
Self::ImportSubUrlError,
Self::SetConfigError,
@@ -129,7 +126,6 @@ mod tests {
fn notice_status_wire_contract() -> Result<(), serde_json::Error> {
let statuses = NoticeStatus::ALL;
let expected = [
- "info",
"import_sub_url::ok",
"import_sub_url::error",
"set_config::error",
diff --git a/src-tauri/src/core/notify/notification.rs b/src-tauri/src/core/notify/notification.rs
index 7ee40b090..c5c07e549 100644
--- a/src-tauri/src/core/notify/notification.rs
+++ b/src-tauri/src/core/notify/notification.rs
@@ -387,11 +387,11 @@ fn sample_frontend_events(uid: &str) -> Vec<(FrontendEvent<'_>, &'static str, se
),
(
FrontendEvent::NoticeMessage {
- status: NoticeStatus::Info,
+ status: NoticeStatus::UpdateFailed,
message: Arc::from("ok"),
},
"verge://notice-message",
- json!(["info", "ok"]),
+ json!(["update_failed", "ok"]),
),
(
FrontendEvent::TimerUpdated { profile_index: uid },
diff --git a/src-tauri/src/core/updater.rs b/src-tauri/src/core/updater.rs
index 061d3da01..648973b43 100644
--- a/src-tauri/src/core/updater.rs
+++ b/src-tauri/src/core/updater.rs
@@ -6,16 +6,16 @@ use parking_lot::Mutex;
use serde::{Deserialize, Serialize};
use std::{
path::PathBuf,
- sync::atomic::{AtomicBool, AtomicU64, Ordering},
+ sync::atomic::{AtomicU64, Ordering},
time::Duration,
};
use tauri_plugin_updater::{Update, UpdaterExt as _};
use tokio_util::sync::CancellationToken;
pub struct SilentUpdater {
- update_ready: AtomicBool,
manual_cancel: Mutex