sendToGroup: Flow errors during key-fetching back up to original sender

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
automated-signal 2021-11-20 08:41:41 -08:00 committed by GitHub
parent 6f78ad8f76
commit a67c02686b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -41,8 +41,11 @@ export async function getKeysForIdentifier(
if (theirUuid) { if (theirUuid) {
await window.textsecure.storage.protocol.archiveAllSessions(theirUuid); await window.textsecure.storage.protocol.archiveAllSessions(theirUuid);
} }
throw new UnregisteredUserError(identifier, error);
} }
throw new UnregisteredUserError(identifier, error);
throw error;
} }
} }

View File

@ -168,7 +168,18 @@ export async function sendContentMessageToGroup({
sendType, sendType,
timestamp, timestamp,
}); });
} catch (error) { } catch (error: unknown) {
if (!(error instanceof Error)) {
throw error;
}
if (error.name.includes('untrusted identity')) {
log.error(
`sendToGroup/${logId}: Failed with 'untrusted identity' error, re-throwing`
);
throw error;
}
log.error( log.error(
`sendToGroup/${logId}: Sender Key send failed, logging, proceeding to normal send`, `sendToGroup/${logId}: Sender Key send failed, logging, proceeding to normal send`,
error && error.stack ? error.stack : error error && error.stack ? error.stack : error
@ -1084,6 +1095,7 @@ async function fetchKeysForIdentifiers(
'fetchKeysForIdentifiers: Failed to fetch keys:', 'fetchKeysForIdentifiers: Failed to fetch keys:',
error && error.stack ? error.stack : error error && error.stack ? error.stack : error
); );
throw error;
} }
} }