Don't wait for pull requests to be fetched in refresh

Fetching pull requests can take a long time, and we don't want to delay
the refresh by it; in particular, for a WithWaitingStatusBlockingInput
we want the UI thread to be unblocked again while pull requests are
still fetching in the background. This is similar to how we fetch the
behind values for branches in BranchLoader; this will update the UI
without much flicker when done, and doesn't have to block anything.
This commit is contained in:
Stefan Haller 2026-07-09 18:28:59 +02:00
parent 2f60280eb6
commit 4ff161b48d

View file

@ -365,13 +365,17 @@ func (self *RefreshHelper) performRefresh(options types.RefreshOptions, calledFr
}
if scopeSet.Includes(types.PULL_REQUESTS) {
refresh("pull requests", func() {
self.onWorker(env.background, func(gocui.Task) error {
branchesAndRemotesWg.Wait()
t := time.Now()
// Use the branches and remotes the loads above stashed, not
// Model().Branches/Remotes: those writes are bounced onto the
// UI thread and may not have landed on this worker yet. The
// wait above orders us after both loads have stashed theirs.
self.refreshGithubPullRequests(loadedBranches, loadedRemotes, env)
self.c.Log.Infof("refreshed pull requests in %s", time.Since(t))
return nil
})
}