Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Pull requests button disappears when changing from a non-GitHub to a GitHub repository #2107
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.
|
Can you explain what is happening to fall into this trap? |
…explorer-button-visibility # Conflicts: # src/GitHub.TeamFoundation.14/Home/ForkNavigationItem.cs
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