From a38a5ac3eb153b8b1b3d9cdf6d23e62ff2726061 Mon Sep 17 00:00:00 2001 From: JusterZhu Date: Thu, 11 Jun 2026 20:59:35 +0800 Subject: [PATCH 1/2] feat: disable backup feature by default Backup is now opt-in rather than opt-out. Users who need backup before applying updates must explicitly set BackupEnabled = true or set the BACKUP environment variable to true. This reduces unnecessary I/O and storage consumption for users who don't require rollback capability. Rollback via backup remains fully functional when enabled. Option.BackupEnabled default: true -> false BackupConfig.Enabled default: true -> false Co-Authored-By: Claude --- src/c#/GeneralUpdate.Core/Configuration/Option.cs | 2 +- src/c#/GeneralUpdate.Core/Configuration/UpdateContext.cs | 2 +- src/c#/GeneralUpdate.Core/FileSystem/StorageManager.cs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/c#/GeneralUpdate.Core/Configuration/Option.cs b/src/c#/GeneralUpdate.Core/Configuration/Option.cs index 2072b3dd..03539905 100644 --- a/src/c#/GeneralUpdate.Core/Configuration/Option.cs +++ b/src/c#/GeneralUpdate.Core/Configuration/Option.cs @@ -124,7 +124,7 @@ public override bool Equals(object? obj) public static Option PatchEnabled { get; } = ValueOf("PATCH", true); - public static Option BackupEnabled { get; } = ValueOf("BACKUP", true); + public static Option BackupEnabled { get; } = ValueOf("BACKUP", false); public static Option Silent { get; } = ValueOf("ENABLESILENTUPDATE", false); diff --git a/src/c#/GeneralUpdate.Core/Configuration/UpdateContext.cs b/src/c#/GeneralUpdate.Core/Configuration/UpdateContext.cs index 3bb06be0..aa0d8889 100644 --- a/src/c#/GeneralUpdate.Core/Configuration/UpdateContext.cs +++ b/src/c#/GeneralUpdate.Core/Configuration/UpdateContext.cs @@ -120,7 +120,7 @@ public class UpdateContext : UpdateConfiguration /// /// Whether to back up the current version before applying an update. - /// Computed from , defaults to true. + /// Computed from , defaults to false. /// public bool? BackupEnabled { get; set; } diff --git a/src/c#/GeneralUpdate.Core/FileSystem/StorageManager.cs b/src/c#/GeneralUpdate.Core/FileSystem/StorageManager.cs index 359bb12a..5f0e53c3 100644 --- a/src/c#/GeneralUpdate.Core/FileSystem/StorageManager.cs +++ b/src/c#/GeneralUpdate.Core/FileSystem/StorageManager.cs @@ -727,9 +727,9 @@ public sealed class BackupConfig public List Directories { get; set; } = new(); /// - /// Whether the backup feature is enabled. Default is true. + /// Whether the backup feature is enabled. Default is false. /// - public bool Enabled { get; set; } = true; + public bool Enabled { get; set; } = false; } /// From a0a50e285fee93ba03008dffd9895bf7a3c6bad3 Mon Sep 17 00:00:00 2001 From: JusterZhu Date: Thu, 11 Jun 2026 21:04:32 +0800 Subject: [PATCH 2/2] fix: update backup tests to match new default (false) Test assertions that expected BackupEnabled default to be true now expect false. Also renamed Options_BackupEnabled_DefaultIsTrue to Options_BackupEnabled_DefaultIsFalse for clarity. Co-Authored-By: Claude --- tests/CoreTest/Configuration/UpdateContextWiringTests.cs | 4 ++-- tests/CoreTest/Configuration/UpdateOptionsStaticTests.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/CoreTest/Configuration/UpdateContextWiringTests.cs b/tests/CoreTest/Configuration/UpdateContextWiringTests.cs index 92f7e90b..19cbc8d1 100644 --- a/tests/CoreTest/Configuration/UpdateContextWiringTests.cs +++ b/tests/CoreTest/Configuration/UpdateContextWiringTests.cs @@ -205,8 +205,8 @@ public void Options_VerifyChecksum_DefaultIsTrue() => Assert.True(Option.VerifyChecksum.DefaultValue); [Fact] - public void Options_BackupEnabled_DefaultIsTrue() - => Assert.True(Option.BackupEnabled.DefaultValue); + public void Options_BackupEnabled_DefaultIsFalse() + => Assert.False(Option.BackupEnabled.DefaultValue); [Fact] public void Options_PatchEnabled_DefaultIsTrue() diff --git a/tests/CoreTest/Configuration/UpdateOptionsStaticTests.cs b/tests/CoreTest/Configuration/UpdateOptionsStaticTests.cs index 90fd6862..58928439 100644 --- a/tests/CoreTest/Configuration/UpdateOptionsStaticTests.cs +++ b/tests/CoreTest/Configuration/UpdateOptionsStaticTests.cs @@ -49,7 +49,7 @@ public void PatchEnabled_HasCorrectDefault() [Fact] public void BackupEnabled_HasCorrectDefault() { - Assert.True(Option.BackupEnabled.DefaultValue); + Assert.False(Option.BackupEnabled.DefaultValue); } [Fact]