Remove overeager caching from merge-branch-chooser #19730
Merged
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 #19710
Description
So in #19626 I added a caching layer to make it really quick to scroll through the list of branches using a keyboard. Unfortunately it took me until debugging #19710 to realise that the cache key I use to cache the results from
getAheadBehind
was...[branchname]
. So for example...main
which is the worst case scenario. Once we had calculated the number of commits from the current branch to main that would get cached (essentially) in perpetuity regardless of what branch you were on and regardless of whether the tip of main had changed or not.The first approach to solving this was to use the tip sha's as the cache key as we do for determineMergeability. Unfortunately it turns out the list of branches and the current branch tip is snapshotted into the
ChooseBranchStep
so it doesn't change until the dialog is closed and reopened.Given that we want this to go out in a hotfix the simplest and safest solution is to just remove the caching for now and look for ways to add it back in later properly.
Screenshots
Release notes
Notes: