This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Pull requests button disappears when changing from a non-GitHub to a GitHub repository#2107
Merged
StanleyGoldman merged 6 commits intomasterfrom Dec 6, 2018
Merged
Conversation
There can be delay before IsAGitHubRepo returns its result. If the repository changes before the call returns, the button can end up with the visibility for the wrong repository. This fix only sets the button visibility if the repository hasn't changed. Button is invalidated multiple times, so one of them returns the visibility for the correct repository.
This would have crashed Visual Studio if Invalidate had thrown. Moved async into a separate InvalidateAsync method.
Contributor
StanleyGoldman
left a comment
There was a problem hiding this comment.
Can you explain what is happening to fall into this trap?
StanleyGoldman
approved these changes
Dec 6, 2018
StanleyGoldman
approved these changes
Dec 6, 2018
…explorer-button-visibility # Conflicts: # src/GitHub.TeamFoundation.14/Home/ForkNavigationItem.cs
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
There can be delay before
IsAGitHubReporeturns its result. If the repository changes before the call returns, the button can end up with the visibility for the wrong repository.This fix only sets the button visibility if the repository hasn't changed. Button is invalidated multiple times, so one of them returns the visibility for the correct repository.
What this PR does
What this PR doesn't do
This is probably only one of a number of issues like this. This is a point fix for the pull requests button disappearing (this is likely to have the most impact). Unfortunately the Team Explorer integration code has become fix upon fix and is difficult to work with and test.
Ideally we would create a view-model that controls visibility of all repository related buttons and UI inside Team Explorer. This would be a large (but worthwhile) refactoring, but is out of scope for this fix.
How to repro
This is what it ends up looking like:
How to test