Story send: Send sync message even in partial failure

This commit is contained in:
Scott Nonnenberg 2022-10-14 17:22:04 -07:00 committed by GitHub
parent 2d5c154e2a
commit 0e49f7906d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 84 additions and 30 deletions

View file

@ -40,11 +40,9 @@ export async function sendDeleteForEveryoneMessage(
const messageModel = window.MessageController.register(messageId, message);
const timestamp = Date.now();
if (
timestamp - targetTimestamp >
(deleteForEveryoneDuration || THREE_HOURS)
) {
throw new Error('Cannot send DOE for a message older than three hours');
const maxDuration = deleteForEveryoneDuration || THREE_HOURS;
if (timestamp - targetTimestamp > maxDuration) {
throw new Error(`Cannot send DOE for a message older than ${maxDuration}`);
}
messageModel.set({