Skip to content

Commit 3851056

Browse files
JusterZhuclaude
andauthored
refactor: remove UpgradeMode pass-through field from Core (#509)
* feat: simplify ClientTest/UpgradeTest for chain and cross-version integration testing - Replace OSS/deprecated silent mode with a single mode-agnostic ClientTest entry point - Remove CLI argument branching (chain/cross-version); the SDK's DownloadPlanBuilder selects CVP vs chain automatically based on server response (IsCrossVersion + FromVersion) - Fix MSBuild CopyUpgradeTest target: stop excluding *.json so UpgradeTest.runtimeconfig.json is bundled as Update.exe, fixing 'hostpolicy.dll not found' launch error - Improve events logging (IsCrossVersion/AppType/FromVersion display in OnUpdateInfo) - Update UpgradeTest with clearer IPC flow documentation Co-Authored-By: Claude <noreply@anthropic.com> * fix: address Copilot review feedback - Replace hard-coded '%TEMP%/...' IPC path with Path.GetTempPath() at runtime - Use OS-agnostic wording for strategy comments (WindowsStrategy → OS strategy) - Use switch expression for AppType display to handle null/unknown values * refactor: remove UpgradeMode field and related logic from Core UpgradeMode was only a pass-through field in GeneralUpdate.Core with no consuming logic. The server-side UpgradeService now always uses the unified response flow (CVP first + chain fallback) instead of three-way branching on UpgradeMode. Changes: - Remove UpgradeMode property from VersionEntry, DownloadAsset - Remove UpgradeMode mapping in HttpDownloadSource and ClientStrategy Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent ae8eb95 commit 3851056

4 files changed

Lines changed: 0 additions & 21 deletions

File tree

src/c#/GeneralUpdate.Core/Configuration/VersionEntry.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -164,24 +164,6 @@ public class VersionEntry : VersionIdentity
164164
[JsonPropertyName("urlExpireTimeUtc")]
165165
public DateTime? UrlExpireTimeUtc { get; set; }
166166

167-
/// <summary>
168-
/// The upgrade mode: 1 = VersionChain (sequential version upgrades), 2 = CrossVersion (cross-version upgrade).
169-
/// </summary>
170-
/// <remarks>
171-
/// <para>
172-
/// <list type="bullet">
173-
/// <item>
174-
/// <description><c>1 (VersionChain)</c>: Upgrades through versions sequentially, without skipping intermediate versions.</description>
175-
/// </item>
176-
/// <item>
177-
/// <description><c>2 (CrossVersion)</c>: Directly upgrades from an old version to any newer version.</description>
178-
/// </item>
179-
/// </list>
180-
/// </para>
181-
/// </remarks>
182-
[JsonPropertyName("upgradeMode")]
183-
public int? UpgradeMode { get; set; }
184-
185167
/// <summary>
186168
/// Whether this is a cross-version upgrade package.
187169
/// <c>true</c> indicates this package is used to upgrade directly from an old version to a new version,

src/c#/GeneralUpdate.Core/Download/Models/DownloadAsset.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public record DownloadAsset(
1818
bool IsForcibly = false,
1919
bool IsFreeze = false,
2020
int RecordId = 0,
21-
int? UpgradeMode = null,
2221
int? AppType = null,
2322
string? AuthScheme = null,
2423
string? AuthToken = null

src/c#/GeneralUpdate.Core/Download/Sources/HttpDownloadSource.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ private static DownloadAsset MapVersionEntry(VersionEntry v)
178178
IsForcibly: v.IsForcibly == true,
179179
IsFreeze: v.IsFreeze == true,
180180
RecordId: v.RecordId,
181-
UpgradeMode: v.UpgradeMode,
182181
AppType: v.AppType,
183182
IsCrossVersion: v.IsCrossVersion == true,
184183
FromVersion: v.FromVersion,

src/c#/GeneralUpdate.Core/Strategy/ClientStrategy.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ private async Task ExecuteStandardWorkflowAsync()
497497
IsForcibly = a.IsForcibly,
498498
IsFreeze = a.IsFreeze,
499499
AppType = a.AppType,
500-
UpgradeMode = a.UpgradeMode,
501500
IsCrossVersion = a.IsCrossVersion,
502501
FromVersion = a.FromVersion
503502
}).ToList();

0 commit comments

Comments
 (0)