Conversation
64ae0a5 to
3ee40c4
Compare
| return event.oneofKind === 'startError'; | ||
| } | ||
|
|
||
| export function notificationRequestOneOfIsCannotProxyGatewayConnection( |
There was a problem hiding this comment.
I wish protobuf-ts had some kind of a switch to tell it that strict null checks are off. AFAIK the only reason we need these helper methods is because the generated type looks like this:
reason: {
oneofKind: "gatewayCertExpired";
gatewayCertExpired: GatewayCertExpired;
} | {
oneofKind: undefined;
};I know that there are some issues with strictNullChecks turned off and boolean fields (microsoft/TypeScript#10564). But I don't get why something like this doesn't narrow the type:
if (request.reason.oneofKind === 'gatewayCertExpired') {
const gateway = this.clustersService.findGateway(
request.reason.gatewayCertExpired.gatewayUri
);Since request.reason.oneofKind is "gatewayCertExpired", it cannot be undefined.
The moment I remove the {oneofKind: undefined} variant, type narrowing seems to work.
There was a problem hiding this comment.
Yeah, I was wondering why the type narrowing doesn't work, I forgot about that undefined thing :/
There was a problem hiding this comment.
I wish protobuf-ts had some kind of a switch to tell it that strict null checks are off
Same, it's the only downside to the library
There was a problem hiding this comment.
Changelog: Fixed a regression issue that caused the re-login dialog reason and proxy errors to not be displayed for database connections in Teleport Connect
I believe this affects all types of connections, doesn't it?
Maybe something like:
Changelog: Fixed a regression with Teleport Connect not showing the re-login reason and connection errors when accessing databases, Kube clusters, and apps with an expired cert
There was a problem hiding this comment.
Much better, thanks :)
As Rafał noticed in #38202 (comment), we stopped showing notifications from the tshd events service. This happens since we migrated to
@protobuf-ts. The property we were overriding inReloginRequestwas replaced byoneOf, so the overridden one became empty.The same issue happened to the relogin requests, fortunately we only stopped showing the relogin reason, the dialog still worked (probably because of that we missed this bug).
Changelog: Fixed a regression with Teleport Connect not showing the re-login reason and connection errors when accessing databases, Kube clusters, and apps with an expired cert