diff --git a/ts/state/ducks/conversations.ts b/ts/state/ducks/conversations.ts index 58f2bc444..07452f9e2 100644 --- a/ts/state/ducks/conversations.ts +++ b/ts/state/ducks/conversations.ts @@ -986,10 +986,11 @@ export function reducer( } } - if (first && oldest && first.received_at < oldest.received_at) { + // Update oldest and newest if we receive older/newer messages (or duplicated timestamps!) + if (first && oldest && first.received_at <= oldest.received_at) { oldest = pick(first, ['id', 'received_at']); } - if (last && newest && last.received_at > newest.received_at) { + if (last && newest && last.received_at >= newest.received_at) { newest = pick(last, ['id', 'received_at']); }