Delete for everyone: Track sends and show failure states

This commit is contained in:
Scott Nonnenberg
2022-03-04 11:22:31 -08:00
committed by GitHub
parent 688cca1806
commit 0a52318be6
24 changed files with 426 additions and 60 deletions

View File

@@ -4,8 +4,7 @@
import type { DeleteModel } from '../messageModifiers/Deletes';
import type { MessageModel } from '../models/messages';
import * as log from '../logging/log';
const ONE_DAY = 24 * 60 * 60 * 1000;
import { DAY } from './durations';
export async function deleteForEveryone(
message: MessageModel,
@@ -19,7 +18,7 @@ export async function deleteForEveryone(
// are less than one day apart
const delta = Math.abs(doe.get('serverTimestamp') - messageTimestamp);
if (delta > ONE_DAY) {
if (delta > DAY) {
log.info('Received late DOE. Dropping.', {
fromId: doe.get('fromId'),
targetSentTimestamp: doe.get('targetSentTimestamp'),