Skip to content

A finished clone is never marked cloned if another repo is selected meanwhile, so it is skipped by Fetch All / Pull All / auto-fetch #481

Description

@matt-edmondson

What's wrong

When a clone completes, the render thread runs Clones.RefreshIfRequested(RefreshPage) (ProjectDirector/ProjectDirector.cs ~L689). RefreshPage (~L812-821) only calls UpdateClonedStatus for Options.Repos[Options.BaseRepo], i.e. whatever repo is selected now, not the repo that was cloned. CloneTracker does not record which path finished.

Failure scenario

  1. Select repo X, click Clone (Clones.TryRun(repo.LocalPath, …), ~L717).
  2. While it runs, select repo Y.
  3. The clone finishes; RefreshPage updates Y's cloned status and re-runs Y's comparison.
  4. X is never added to Options.ClonedRepos: its indicator stays grey, and FetchAllReposIfStale, Fetch All and Pull All (which iterate ClonedRepos) skip it.
  5. Startup's RefreshPage also only checks the selected repo, so the state persists across restarts until X is selected again or a full scan runs.

Side effect: any clone completion restarts the comparison for the selected repo and resets its browser path to the root.

Why it matters

Selecting another repo while a clone runs is the natural thing to do (clones take a while), and the outcome is a silently untracked working copy that never gets fetched.

Suggested fix

Have CloneTracker record the local paths that completed; on the render thread call UpdateClonedStatus for each of those repos (or the parameterless full UpdateClonedStatus()), and only re-run SwitchPage when the completed repo is the selected one or one of its similar repos.

Acceptance criteria

  • After cloning X and switching to Y before completion, X is in ClonedRepos and shows as cloned.
  • Completion of X's clone doesn't reset Y's comparison/browse state unless X is related to Y.
  • A test on CloneTracker asserts the completed path is reported to the refresh callback.

Not covered by #439 / #474, which only moved the refresh onto the render thread.

No activity

Activity on this issue will appear here.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions