Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2495,9 +2495,10 @@ def _normalized_message_timestamp_for_key(value):
timestamp = float(value)
except (TypeError, ValueError):
return str(value)
if timestamp.is_integer():
return str(int(timestamp))
return ("%.6f" % timestamp).rstrip("0").rstrip(".")
# Truncate to second-level granularity so that sub-second drift between
# the sidecar JSON write and the state.db created_at write does not cause
# the legacy dedup key to differ for the same logical message.
return str(int(timestamp))


def _message_timestamp_as_float(msg):
Expand Down