Ensure unauthenticated websocket reconnects if using LibSignal's transport

This commit is contained in:
trevor-signal 2024-04-18 13:00:16 -04:00 committed by GitHub
parent 97f5430541
commit ec2a17a0e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -592,21 +592,23 @@ export class SocketManager extends EventListener {
`SocketManager: connecting unauthenticated socket, transport option [${transportOption}]`
);
let process: AbortableProcess<IWebSocketResource>;
if (transportOption === TransportOption.Libsignal) {
this.unauthenticated = this.connectLibsignalUnauthenticated();
return this.unauthenticated.getResult();
process = this.connectLibsignalUnauthenticated();
} else {
process = this.connectResource({
name: UNAUTHENTICATED_CHANNEL_NAME,
path: '/v1/websocket/',
proxyAgent,
resourceOptions: {
name: UNAUTHENTICATED_CHANNEL_NAME,
keepalive: { path: '/v1/keepalive' },
transportOption,
},
});
}
const process = this.connectResource({
name: UNAUTHENTICATED_CHANNEL_NAME,
path: '/v1/websocket/',
proxyAgent,
resourceOptions: {
name: UNAUTHENTICATED_CHANNEL_NAME,
keepalive: { path: '/v1/keepalive' },
transportOption,
},
});
this.unauthenticated = process;
let unauthenticated: IWebSocketResource;