-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't issue GetCapabilities calls if the requirement is NONE #20355
Conversation
// Don't issue GetCapabilities calls if the requirement is NONE because the endpoint, | ||
// e.g. Remote Asset API, might not implement the API. See #20342. | ||
if (requirement == ServerCapabilitiesRequirement.NONE) { | ||
return Single.just( | ||
new ChannelConnectionWithServerCapabilities(channel, serverCapabilitiesSingle)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the logic reversed? This to me reads as "if the requirement is NONE, then call getAndVerifyServerCapabilities".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. serverCapabilitiesSingle
is a lazy evaluation of getAndVerifyServerCapabilities
.
If the requirement is NONE, we store it and call getAndVerifyServerCapabilities
only when ChannelConnectionWithServerCapabilities#getCapabilities
is called.
Otherwise, we evaluate the single now which calls getAndVerifyServerCapabilities
immediately.
Because the endpoint might not implement the `GetCapabilities` API, e.g. Remote Asset API. Fixes bazelbuild#20342. Closes bazelbuild#20355. PiperOrigin-RevId: 586642258 Change-Id: If9ca3a1909729ea5d9410b7198bcacb5d67781aa
Because the endpoint might not implement the
GetCapabilities
API, e.g. Remote Asset API.Fixes #20342.