Move a number of sync messages to jobs for retry

This commit is contained in:
Scott Nonnenberg 2022-01-14 13:34:52 -08:00 committed by GitHub
parent 74aaf7819a
commit 90356d4c0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 501 additions and 373 deletions

View file

@ -3,7 +3,7 @@
import { assert } from 'chai';
import * as sinon from 'sinon';
import { noop } from 'lodash';
import { noop, omit } from 'lodash';
import { HTTPError } from '../../../textsecure/Errors';
import { SECOND } from '../../../util/durations';
@ -63,6 +63,17 @@ describe('handleMultipleSendErrors', () => {
sinon.assert.calledOnceWithExactly(markFailed);
});
it("doesn't require `markFailed`", async () => {
await assert.isRejected(
handleMultipleSendErrors({
...omit(defaultOptions, 'markFailed'),
errors: [new Error('Test message')],
isFinalAttempt: true,
}),
'Test message'
);
});
describe('413 handling', () => {
it('sleeps for the longest 413 Retry-After time', async () => {
let done = false;