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