mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-27 16:00:09 +08:00
refactor(updater): drop the never-matching break-change gate (#8742)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -605,21 +605,6 @@ impl SilentUpdater {
|
||||
let version = update.version.as_str();
|
||||
logging!(info, Type::System, "Silent updater: update available: v{version}");
|
||||
|
||||
if let Some(body) = &update.body
|
||||
&& body.to_lowercase().contains("break change")
|
||||
{
|
||||
logging!(
|
||||
info,
|
||||
Type::System,
|
||||
"Silent updater: breaking change detected in v{version}, notifying frontend"
|
||||
);
|
||||
super::handle::Handle::notice(
|
||||
super::notify::NoticeStatus::Info,
|
||||
format!("New version v{version} contains breaking changes. Please update manually."),
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if Self::verified_cache(&update).is_some() {
|
||||
logging!(info, Type::System, "Silent updater: v{version} already cached");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user