Skip to content

Don't overwrite refreshed history with a stale commit batch - #23025

Closed
Arthur031221 wants to merge 1 commit into
desktop:developmentfrom
Arthur031221:fix-history-stale-commit-batch
Closed

Arthur031221 wants to merge 1 commit into
desktop:developmentfrom
Arthur031221:fix-history-stale-commit-batch

Conversation

@Arthur031221

Copy link
Copy Markdown

Closes #22064

Description

On a branch with only a few commits, the History list sits close enough to the bottom that it always asks for the next batch of commits. If you commit while that request is still running, the history gets refreshed to include the new commit. Then the request finishes, appends its batch to the list it captured before the commit, and writes that back. The oldest commit shows up again and the newest one is gone until you restart the app.

_loadNextCommitBatch now re-reads the compare state after loading and drops the batch if commitSHAs isn't the list it started from. Other async loads in AppStore already do this.

Added app-store-history-test.ts, which refreshes the history while a batch is loading and checks the refreshed list is kept. yarn test app/test/unit/stores/app-store-history-test.ts passes.

Release notes

Notes: [Fixed] History no longer repeats the first commit and hides the newest one after committing on a short branch

Assisted by Claude/Codex.

When a commit is made while the History tab is loading its next batch, the batch was appended to the list captured before the commit. On short branches this showed the oldest commit repeatedly and hid the new one. Drop the batch if the list changed while it was loading.

Signed-off-by: Arthur031221 <[email protected]>
@Arthur031221
Arthur031221 requested a review from a team as a code owner October 15, 2026 16:52
@github-actions github-actions Bot added external Pull request originating outside of the Desktop core team needs-triage ready-for-review Pull Requests that are ready to be reviewed by the maintainers and removed needs-triage labels Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your pull request! While it doesn't meet all of our standard requirements, it appears to be a small, focused contribution and has been routed to the team for review.

Note: We still encourage linking to an issue with the help wanted label when possible, as it helps us prioritize and track contributions.

@Arthur031221

Copy link
Copy Markdown
Author

Anything else you need from me on this one? Happy to adjust it.

@Arthur031221

Copy link
Copy Markdown
Author

Fixed by #23238, closing this one.

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

Labels

external Pull request originating outside of the Desktop core team ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After committing on a branch with very few commits, the History view sometimes displays incorrectly

1 participant