Repository navigation
fix(desktop): force log refresh when reset or checkout moves HEAD - #214
Merged
Merged
Conversation
When resetting or checking out a commit, the top commit of an all-refs log may not change if another ref remains on top. Force log reloading so branch and HEAD labels update immediately in the Git tree. 🪄 Commit via GitWand
Collaborator
Author
|
Fix that issue: #213 |
Switching branch/author filter or monorepo scope now fetches only the first page and cancels the prefetch. A view epoch drops any in-flight page that belongs to the old view. 🪄 Commit via GitWand
A forced reload refetched the whole prefetched log. Track the deepest visible row from the graph and refetch only down to it plus a page; the background prefetch refills the rest. 🪄 Commit via GitWand
devlint
approved these changes
Oct 6, 2026
devlint
left a comment
Owner
There was a problem hiding this comment.
Checked locally: vue-tsc clean, 1614 desktop tests pass.
The root cause of #213 holds up: after a reset/checkout the all-refs log's top commit (origin/<branch>) doesn't move, so the unforced reload kept the stale log until the next poll. Forcing it, and capping the forced depth at the viewed row + one page instead of the whole prefetched history (up to 5000 commits), addresses both the staleness and the cost.
The view epoch looks right: stale pages are dropped in both loadLog and loadMoreLog, and logLoadingMore is only cleared by the fetch that owns it.
Non-blocking:
- The epoch /
forcedReloadDepthlogic has no test; a smalluseGitRepotest for 'filter change during an in-flight page' would lock it in. - The view anchor is only reported by CommitGraph; from the list view a forced reload falls back to one page (fine, just noting).
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Forces git log reloading when a reset or checkout operation moves HEAD, even if the top commit of an all-refs log remains unchanged. This ensures that branch and HEAD labels are immediately updated and accurately reflected in the Git tree.
Also, the switching branch/author filter or monorepo scope now fetches only the first
page and cancels the prefetch. A view epoch drops any in-flight page that
belongs to the old view.
Changes
useCommitActions.App.vueto handle the forced log refresh triggers.useCommitActions-refresh.test.tsto verify log reloading behavior when HEAD moves.Test plan
useCommitActionsrefresh behavior passes.