Ensure that oldest/newest are correct given duplicate timestamps
This commit is contained in:
parent
de630a2ea8
commit
4f16cf595c
|
@ -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']);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue