sendToGroup: Don't fail send if we get 401 from multi_recipient/ request

This commit is contained in:
Scott Nonnenberg 2023-01-20 16:50:34 -08:00 committed by GitHub
parent b5947e0ef1
commit 7c1f186c05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View file

@ -15,12 +15,14 @@ import type { DeviceType } from '../../textsecure/Types.d';
import {
ConnectTimeoutError,
HTTPError,
IncorrectSenderKeyAuthError,
MessageError,
OutgoingIdentityKeyError,
OutgoingMessageError,
SendMessageChallengeError,
SendMessageNetworkError,
SendMessageProtoError,
UnknownRecipientError,
UnregisteredUserError,
} from '../../textsecure/Errors';
@ -219,6 +221,16 @@ describe('sendToGroup', () => {
assert.isFalse(_shouldFailSend(error, 'testing generic 204'));
});
it('returns false for specific errors', () => {
const unknownRecipient = new UnknownRecipientError();
assert.isFalse(
_shouldFailSend(unknownRecipient, 'testing unknown recipient')
);
const incorrectAuth = new IncorrectSenderKeyAuthError();
assert.isFalse(_shouldFailSend(incorrectAuth, 'testing incorrect auth'));
});
it('returns true for a specified error codes', () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const error: any = new Error('generic');