sendToGroup: Don't fail send if we get 401 from multi_recipient/ request
This commit is contained in:
parent
b5947e0ef1
commit
7c1f186c05
3 changed files with 23 additions and 1 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue