Repository navigation
Fix commits missing in History tab - #12553
Merged
Merged
Conversation
sergiou87
commented
Jul 2, 2021
Comment on lines
-204
to
-234
| /** Load the next batch of history, starting from the last loaded commit. */ | ||
| public async loadNextHistoryBatch() { | ||
| if (this.requestsInFight.has(LoadingHistoryRequestKey)) { | ||
| return | ||
| } | ||
|
|
||
| if (!this.history.length) { | ||
| return | ||
| } | ||
|
|
||
| const lastSHA = this.history[this.history.length - 1] | ||
| const requestKey = `history/${lastSHA}` | ||
| if (this.requestsInFight.has(requestKey)) { | ||
| return | ||
| } | ||
|
|
||
| this.requestsInFight.add(requestKey) | ||
|
|
||
| const commits = await this.performFailableOperation(() => | ||
| getCommits(this.repository, `${lastSHA}^`, CommitBatchSize) | ||
| ) | ||
| if (!commits) { | ||
| return | ||
| } | ||
|
|
||
| this._history = this._history.concat(commits.map(c => c.sha)) | ||
| this.storeCommits(commits) | ||
| this.requestsInFight.delete(requestKey) | ||
| this.emitUpdate() | ||
| } | ||
|
|
Member
Author
There was a problem hiding this comment.
This wasn't used at all anymore 😅
tidy-dev
approved these changes
Jul 14, 2021
billygriffin
approved these changes
Jul 14, 2021
billygriffin
left a comment
Contributor
There was a problem hiding this comment.
Amazing job finding the culprit @sergiou87! ✨
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.

Closes #12506
Closes #3704
Description
I think #12506 (comment) gives good context about the reason behind this bug. Luckily,
githas a--skipparameter, so with the changes in this PR, when we need to load a new page of commits, we'll rungit logfromHEADand skip the X first commits.In order to test this, you can create a repository with two branches alternating commits between two branches and finally merging them, using this script:
Screenshots
Without the fix, after the second page is loaded, you only see commits from one of the branches (either odd or even numbers in the test repo):
Screen.Recording.2021-07-02.at.12.14.11.mov
With the fix, you always see both odd and even numbers:
Screen.Recording.2021-07-02.at.12.15.16.mov
Release notes
Notes: [Fixed] History tab shows all commits as the user scrolls down