Adopt libsignal-net version with no auto-reconnect
Co-authored-by: Jordan Rose <jrose@signal.org>
This commit is contained in:
parent
00e6071b1d
commit
30a419bb2a
7 changed files with 139 additions and 71 deletions
|
@ -591,14 +591,12 @@ export class SocketManager extends EventListener {
|
|||
: TransportOption.Original;
|
||||
}
|
||||
|
||||
private connectLibsignalUnauthenticated(): AbortableProcess<IWebSocketResource> {
|
||||
return connectUnauthenticatedLibsignal({
|
||||
libsignalNet: this.libsignalNet,
|
||||
name: UNAUTHENTICATED_CHANNEL_NAME,
|
||||
});
|
||||
}
|
||||
|
||||
private async getUnauthenticatedResource(): Promise<IWebSocketResource> {
|
||||
// awaiting on `this.getProxyAgent()` needs to happen here
|
||||
// so that there are no calls to `await` between checking
|
||||
// the value of `this.unauthenticated` and assigning it later in this function
|
||||
const proxyAgent = await this.getProxyAgent();
|
||||
|
||||
if (this.unauthenticated) {
|
||||
return this.unauthenticated.getResult();
|
||||
}
|
||||
|
@ -613,8 +611,6 @@ export class SocketManager extends EventListener {
|
|||
|
||||
log.info('SocketManager: connecting unauthenticated socket');
|
||||
|
||||
const proxyAgent = await this.getProxyAgent();
|
||||
|
||||
const transportOption = this.transportOption(proxyAgent);
|
||||
log.info(
|
||||
`SocketManager: connecting unauthenticated socket, transport option [${transportOption}]`
|
||||
|
@ -623,7 +619,10 @@ export class SocketManager extends EventListener {
|
|||
let process: AbortableProcess<IWebSocketResource>;
|
||||
|
||||
if (transportOption === TransportOption.Libsignal) {
|
||||
process = this.connectLibsignalUnauthenticated();
|
||||
process = connectUnauthenticatedLibsignal({
|
||||
libsignalNet: this.libsignalNet,
|
||||
name: UNAUTHENTICATED_CHANNEL_NAME,
|
||||
});
|
||||
} else {
|
||||
process = this.connectResource({
|
||||
name: UNAUTHENTICATED_CHANNEL_NAME,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue