Handle duplicate receivedAt timestamps for MESSAGE_RESET event

This commit is contained in:
Scott Nonnenberg 2020-02-03 11:32:03 -08:00 committed by GitHub
parent 4f16cf595c
commit 682ac656c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -741,12 +741,12 @@ export function reducer(
// If our metrics are a little out of date, we'll fix them up
if (messages.length > 0) {
const first = messages[0];
if (first && (!oldest || first.received_at < oldest.received_at)) {
if (first && (!oldest || first.received_at <= oldest.received_at)) {
oldest = pick(first, ['id', 'received_at']);
}
const last = messages[messages.length - 1];
if (last && (!newest || last.received_at > newest.received_at)) {
if (last && (!newest || last.received_at >= newest.received_at)) {
newest = pick(last, ['id', 'received_at']);
}
}