Skip to content

静默更新模式 SilentPollOrchestrator 与标准流程不一致导致三个 Bug #471

Description

@JusterZhu

问题描述

静默更新模式的 SilentPollOrchestrator 独立重新实现了一套更新逻辑,与标准 ClientStrategy 流程大量重复但缺失关键注入,导致以下 Bug:

Bug #1: PatchMiddleware 在静默模式必定抛异常(阻断性)

SilentPollOrchestrator.CreateStrategy() 创建了裸的 WindowsStrategy,没有注入 DiffPipeline。当 PatchEnabled=true(默认值)时,PatchMiddleware 在 PipelineContext 中找不到 DiffPipeline,抛出 InvalidOperationException。异常被 catch 后轮询重试,但每次必定失败——无限重试循环

Bug #2: Upgrade-only 场景下多余启动升级进程

当只有 Upgrade 包无需 Client 包时,OnProcessExit 仍然无条件启动 updaterPath(IPC 只受 _preparedProcessInfo != null 守卫,但 Process.Start 调用不受守卫)。

Bug #3: 下载行为忽略用户配置

静默模式下 DefaultDownloadOrchestrator 创建时未使用 DownloadOrchestratorOptions.From(config),导致用户配置的 MaxConcurrencyEnableResumeRetryCountVerifyChecksum 等选项全部无效。

根本原因

SilentPollOrchestrator.PrepareUpdateIfNeededAsync() 是一个 ~300 行的独立实现,与 ClientStrategy.ExecuteStandardWorkflowAsync() 功能等同但缺少扩展点注入。静默更新本应是「标准流程 + 轮询」,实际变成了「重新实现 - 关键组件」。

解决方案

SilentPollOrchestrator 从「重新实现者」变成「调度者」——委托 ClientStrategy 执行所有更新逻辑,自己只负责轮询调度和 ProcessExit 衔接。

相关 PR

待创建

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions