mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-17 07:13:24 +01:00
Enable tsconfig noUncheckedIndexedAccess
This commit is contained in:
@@ -137,6 +137,7 @@ export async function happyEyeballs({
|
||||
const results = await Promise.allSettled(
|
||||
interleaved.map(async (addr, index) => {
|
||||
const abortController = abortControllers[index];
|
||||
strictAssert(abortController, 'Missing abortController');
|
||||
if (index !== 0) {
|
||||
await sleep(index * DELAY_MS, abortController.signal);
|
||||
}
|
||||
@@ -185,17 +186,22 @@ export async function happyEyeballs({
|
||||
'Fulfilled promise was not fulfilled'
|
||||
);
|
||||
const { socket, index } = fulfilled.value;
|
||||
const address = interleaved[index];
|
||||
strictAssert(address, 'Missing address');
|
||||
|
||||
return {
|
||||
socket,
|
||||
address: interleaved[index],
|
||||
address,
|
||||
v4Attempts,
|
||||
v6Attempts,
|
||||
};
|
||||
}
|
||||
|
||||
const firstResult = results[0];
|
||||
strictAssert(firstResult, 'Missing firstResult');
|
||||
|
||||
strictAssert(
|
||||
results[0].status === 'rejected',
|
||||
firstResult.status === 'rejected',
|
||||
'No fulfilled promises, but no rejected either'
|
||||
);
|
||||
|
||||
@@ -203,7 +209,7 @@ export async function happyEyeballs({
|
||||
for (const controller of abortControllers) {
|
||||
controller.abort();
|
||||
}
|
||||
throw results[0].reason;
|
||||
throw firstResult.reason;
|
||||
}
|
||||
|
||||
export type ConnectOptionsType = Readonly<{
|
||||
|
||||
Reference in New Issue
Block a user