Hot socket
This commit is contained in:
1046
ACKNOWLEDGMENTS.md
1046
ACKNOWLEDGMENTS.md
File diff suppressed because it is too large
Load Diff
@@ -118,7 +118,7 @@
|
|||||||
"@react-aria/focus": "3.19.1",
|
"@react-aria/focus": "3.19.1",
|
||||||
"@react-aria/utils": "3.25.3",
|
"@react-aria/utils": "3.25.3",
|
||||||
"@react-spring/web": "9.7.5",
|
"@react-spring/web": "9.7.5",
|
||||||
"@signalapp/libsignal-client": "0.67.3",
|
"@signalapp/libsignal-client": "0.67.4",
|
||||||
"@signalapp/quill-cjs": "2.1.2",
|
"@signalapp/quill-cjs": "2.1.2",
|
||||||
"@signalapp/ringrtc": "2.50.2",
|
"@signalapp/ringrtc": "2.50.2",
|
||||||
"@signalapp/sqlcipher": "1.0.0",
|
"@signalapp/sqlcipher": "1.0.0",
|
||||||
|
10
pnpm-lock.yaml
generated
10
pnpm-lock.yaml
generated
@@ -128,8 +128,8 @@ importers:
|
|||||||
specifier: 9.7.5
|
specifier: 9.7.5
|
||||||
version: 9.7.5(react-dom@17.0.2(react@17.0.2))(react@17.0.2)
|
version: 9.7.5(react-dom@17.0.2(react@17.0.2))(react@17.0.2)
|
||||||
'@signalapp/libsignal-client':
|
'@signalapp/libsignal-client':
|
||||||
specifier: 0.67.3
|
specifier: 0.67.4
|
||||||
version: 0.67.3
|
version: 0.67.4
|
||||||
'@signalapp/quill-cjs':
|
'@signalapp/quill-cjs':
|
||||||
specifier: 2.1.2
|
specifier: 2.1.2
|
||||||
version: 2.1.2
|
version: 2.1.2
|
||||||
@@ -2540,8 +2540,8 @@ packages:
|
|||||||
'@signalapp/libsignal-client@0.60.2':
|
'@signalapp/libsignal-client@0.60.2':
|
||||||
resolution: {integrity: sha512-tU4kNP/yCwkFntb2ahXOSQJtzdy+YifAB2yv5hw0qyKSidRHLn6bYiz4Zo2tjxLDRoBLAUxCRsQramStiqNZdA==}
|
resolution: {integrity: sha512-tU4kNP/yCwkFntb2ahXOSQJtzdy+YifAB2yv5hw0qyKSidRHLn6bYiz4Zo2tjxLDRoBLAUxCRsQramStiqNZdA==}
|
||||||
|
|
||||||
'@signalapp/libsignal-client@0.67.3':
|
'@signalapp/libsignal-client@0.67.4':
|
||||||
resolution: {integrity: sha512-GIiXJMqiIByPZbomytoYQcQLJ3pNgHBCjt5BvlE/3rkrmNwyXW1UVqszX6/WfZi91aqUapO4+7Op+8JCbDGRWA==}
|
resolution: {integrity: sha512-nenGxomG2zH0uCoFSwBzofqSAHnJRdbIbLr8libGy9y3rCL2z62nHL79Kh1o46ZnzxgAA7Ay3/qMhwPcXq7Iig==}
|
||||||
|
|
||||||
'@signalapp/mock-server@11.1.0':
|
'@signalapp/mock-server@11.1.0':
|
||||||
resolution: {integrity: sha512-SYYek3QCh57vZZGNVQW+fSXMr+xHjnO8sMAFfj8DovjqW4HIBWbt3itGyyjxSoIXnaCMK346O6I/R79w8xY/aw==}
|
resolution: {integrity: sha512-SYYek3QCh57vZZGNVQW+fSXMr+xHjnO8sMAFfj8DovjqW4HIBWbt3itGyyjxSoIXnaCMK346O6I/R79w8xY/aw==}
|
||||||
@@ -12254,7 +12254,7 @@ snapshots:
|
|||||||
type-fest: 4.26.1
|
type-fest: 4.26.1
|
||||||
uuid: 8.3.2
|
uuid: 8.3.2
|
||||||
|
|
||||||
'@signalapp/libsignal-client@0.67.3':
|
'@signalapp/libsignal-client@0.67.4':
|
||||||
dependencies:
|
dependencies:
|
||||||
node-gyp-build: 4.8.4
|
node-gyp-build: 4.8.4
|
||||||
type-fest: 4.26.1
|
type-fest: 4.26.1
|
||||||
|
@@ -17,6 +17,7 @@ import type { Readable } from 'stream';
|
|||||||
|
|
||||||
import { Net } from '@signalapp/libsignal-client';
|
import { Net } from '@signalapp/libsignal-client';
|
||||||
import { assertDev, strictAssert } from '../util/assert';
|
import { assertDev, strictAssert } from '../util/assert';
|
||||||
|
import { drop } from '../util/drop';
|
||||||
import { isRecord } from '../util/isRecord';
|
import { isRecord } from '../util/isRecord';
|
||||||
import * as durations from '../util/durations';
|
import * as durations from '../util/durations';
|
||||||
import type { ExplodePromiseResultType } from '../util/explodePromise';
|
import type { ExplodePromiseResultType } from '../util/explodePromise';
|
||||||
@@ -116,9 +117,6 @@ function resolveLibsignalNet(
|
|||||||
TESTING_localServer_chatPort: parseInt(getMockServerPort(url), 10),
|
TESTING_localServer_chatPort: parseInt(getMockServerPort(url), 10),
|
||||||
TESTING_localServer_cdsiPort: DISCARD_PORT,
|
TESTING_localServer_cdsiPort: DISCARD_PORT,
|
||||||
TESTING_localServer_svr2Port: DISCARD_PORT,
|
TESTING_localServer_svr2Port: DISCARD_PORT,
|
||||||
TESTING_localServer_svr3SgxPort: DISCARD_PORT,
|
|
||||||
TESTING_localServer_svr3NitroPort: DISCARD_PORT,
|
|
||||||
TESTING_localServer_svr3Tpm2SnpPort: DISCARD_PORT,
|
|
||||||
TESTING_localServer_rootCertificateDer: pemToDer(certificateAuthority),
|
TESTING_localServer_rootCertificateDer: pemToDer(certificateAuthority),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1692,6 +1690,46 @@ export type TopLevelType = {
|
|||||||
|
|
||||||
type InflightCallback = (error: Error) => unknown;
|
type InflightCallback = (error: Error) => unknown;
|
||||||
|
|
||||||
|
// `libsignalNet` is an instance of a class from libsignal that is responsible
|
||||||
|
// for providing network layer API and related functionality.
|
||||||
|
// It's important to have a single instance of this class as it holds
|
||||||
|
// resources that are shared across all other use cases.
|
||||||
|
let libsignalNet: Net.Net;
|
||||||
|
|
||||||
|
// Not definied in tests
|
||||||
|
if (window.SignalContext.config?.serverUrl) {
|
||||||
|
const { config } = window.SignalContext;
|
||||||
|
|
||||||
|
libsignalNet = resolveLibsignalNet(
|
||||||
|
config.serverUrl,
|
||||||
|
config.version,
|
||||||
|
config.certificateAuthority
|
||||||
|
);
|
||||||
|
|
||||||
|
libsignalNet.setIpv6Enabled(!config.disableIPv6);
|
||||||
|
if (config.proxyUrl) {
|
||||||
|
log.info('WebAPI: Setting libsignal proxy');
|
||||||
|
try {
|
||||||
|
libsignalNet.setProxyFromUrl(config.proxyUrl);
|
||||||
|
} catch (error) {
|
||||||
|
log.error(`WebAPI: Failed to set proxy: ${error}`);
|
||||||
|
libsignalNet.clearProxy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
drop(
|
||||||
|
(async () => {
|
||||||
|
try {
|
||||||
|
log.info('WebAPI: preconnect start');
|
||||||
|
await libsignalNet.preconnectChat();
|
||||||
|
log.info('WebAPI: preconnect done');
|
||||||
|
} catch (error) {
|
||||||
|
log.error(`WebAPI: Failed to preconnect: ${toLogFormat(error)}`);
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// We first set up the data that won't change during this session of the app
|
// We first set up the data that won't change during this session of the app
|
||||||
export function initialize({
|
export function initialize({
|
||||||
chatServiceUrl,
|
chatServiceUrl,
|
||||||
@@ -1704,7 +1742,6 @@ export function initialize({
|
|||||||
contentProxyUrl,
|
contentProxyUrl,
|
||||||
proxyUrl,
|
proxyUrl,
|
||||||
version,
|
version,
|
||||||
disableIPv6,
|
|
||||||
}: InitializeOptionsType): WebAPIConnectType {
|
}: InitializeOptionsType): WebAPIConnectType {
|
||||||
if (!isString(chatServiceUrl)) {
|
if (!isString(chatServiceUrl)) {
|
||||||
throw new Error('WebAPI.initialize: Invalid chatServiceUrl');
|
throw new Error('WebAPI.initialize: Invalid chatServiceUrl');
|
||||||
@@ -1743,26 +1780,6 @@ export function initialize({
|
|||||||
throw new Error('WebAPI.initialize: Invalid version');
|
throw new Error('WebAPI.initialize: Invalid version');
|
||||||
}
|
}
|
||||||
|
|
||||||
// `libsignalNet` is an instance of a class from libsignal that is responsible
|
|
||||||
// for providing network layer API and related functionality.
|
|
||||||
// It's important to have a single instance of this class as it holds
|
|
||||||
// resources that are shared across all other use cases.
|
|
||||||
const libsignalNet = resolveLibsignalNet(
|
|
||||||
chatServiceUrl,
|
|
||||||
version,
|
|
||||||
certificateAuthority
|
|
||||||
);
|
|
||||||
libsignalNet.setIpv6Enabled(!disableIPv6);
|
|
||||||
if (proxyUrl) {
|
|
||||||
log.info('Setting libsignal proxy');
|
|
||||||
try {
|
|
||||||
libsignalNet.setProxyFromUrl(proxyUrl);
|
|
||||||
} catch (error) {
|
|
||||||
log.error(`Failed to set proxy: ${error}`);
|
|
||||||
libsignalNet.clearProxy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// We store server alerts (returned on the WS upgrade response headers) so that the app
|
// We store server alerts (returned on the WS upgrade response headers) so that the app
|
||||||
// can query them later, which is necessary if they arrive before app state is ready
|
// can query them later, which is necessary if they arrive before app state is ready
|
||||||
let serverAlerts: Array<ServerAlert> = [];
|
let serverAlerts: Array<ServerAlert> = [];
|
||||||
|
Reference in New Issue
Block a user