Fixes isMaybeConnected to let it return undefined when the value is unknown #4145
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.
Description
The problem
I've noticed that here the
connectedvariable is always boolean and can never be equal tonull, so we always skip theifbody here:vscode-gitlens/src/git/gitProviderService.ts
Lines 1143 to 1149 in fef314b
Therefore, integrations with
unknownconnection status never get saved here:vscode-gitlens/src/git/gitProviderService.ts
Lines 1191 to 1194 in fef314b
As a result we don't see them on reading. For example in the List of Remotes it didn't see a connected Bitbucket integration and didn't request for PRs:
vscode-gitlens/src/views/nodes/branchNode.ts
Lines 178 to 184 in fef314b
Investigation
I've noticed that the related code only changed once and the "always boolean effect" might appear occasionally.
Suggested solution
I suggest we should let it be
undefinedagain.Checklist
Fixes $XXX -orCloses #XXX -prefix to auto-close the issue that your PR addresses