Skip to content

Commit db76583

Browse files
committed
fix: retain legacy UTC JSONL timestamps
1 parent a1b056d commit db76583

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

airlock/tui/screens/logs.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,12 @@ def _matches_snapshot(record: dict[str, Any], filters: dict[str, str]) -> bool:
8484
if search not in " ".join(str(record.get(key) or "") for key in keys).lower():
8585
return False
8686
try:
87-
timestamp = datetime.fromisoformat(
88-
str(record.get("timestamp", "")).replace("Z", "+00:00")
89-
)
87+
raw_timestamp = str(record.get("timestamp", ""))
88+
# Older JSONL fixtures/producers occasionally emitted ``+00:00Z``.
89+
# Treat it as UTC rather than dropping an otherwise valid record.
90+
if raw_timestamp.endswith("+00:00Z"):
91+
raw_timestamp = raw_timestamp[:-1]
92+
timestamp = datetime.fromisoformat(raw_timestamp.replace("Z", "+00:00"))
9093
except ValueError:
9194
return False
9295
now = datetime.now(timezone.utc)

0 commit comments

Comments
 (0)