Skip to content

SetCustomSkipOption runs before update info is available #459

Description

@JusterZhu

Problem

SetCustomSkipOption(Func<bool>) was evaluated in LaunchWithStrategy() BEFORE ExecuteAsync(), meaning the user had zero update information when deciding whether to skip. Meanwhile AddListenerUpdatePrecheck(Func<UpdateInfoEventArgs, bool>) ran inside ClientUpdateStrategy.CanSkip() WITH full version info from the server.

Two skip mechanisms with different timing and different capabilities.

Fix

Merged into one (AddListenerUpdatePrecheck):

  • SetCustomSkipOption removed from GeneralUpdateBootstrap
  • The callback now runs in ClientUpdateStrategy.CanSkip() after server validation returns update info
  • Callback receives UpdateInfoEventArgs with full version details

Usage

new GeneralUpdateBootstrap()
    .SetConfig(config)
    .AddListenerUpdatePrecheck(info =>
    {
        // info contains all available update versions
        return info.Versions.Any(v => v.Version == "2.0.0"); // skip 2.0.0
    })
    .LaunchAsync();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions