Repository navigation
fix(telemetry): a sink record's day comes from the moment it parses to - #827
Merged
Merged
Conversation
…o, never from its text telemetrySinkRecordDayKey sliced the first ten characters of any parseable timestamp ending in Z. A moment not written in canonical ISO form got the wrong day or no day at all: "2026-09-10T24:00:00Z" read as 2026-09-10 instead of 2026-09-11, "Thu, 10 Sep 2026 23:00:00 Z" as "Thu, 10 Se", a key outside every period, so the record left a report without being counted as undated. The day is now always the parsed moment's UTC day. Two tests, both red before the change. The three comment lines that explained the shortcut go with it, and the src comment ceiling drops by the same three. Fixes #825 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb AIDD-Session-Id: 4acc9a1c-19bc-4468-b8b6-e86644bcba60
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What & why
telemetrySinkRecordDayKeydecides which UTC day a stored telemetry record belongs to. That day chooses the periods a report counts it in. Once the timestamp parsed, it took a shortcut: any string ending inZwas sliced to its first ten characters. A moment that parses but is not in canonical ISO form got the wrong day, or a key that is no day at all. That key sits outside every period, so the record silently left a report without being counted as undated.event_timestamp2026-09-10T24:00:00Z2026-09-102026-09-11Thu, 10 Sep 2026 23:00:00 ZThu, 10 Se2026-09-10+002026-09-10T10:00:00Z+002026-092026-09-10🛠️ How it works
parsed.toISOString().slice(0, 10).srccomment ceiling incomments.arch.test.tsdrops by the same three lines, 4474 → 4471.🧪 How to verify
Typecheck, lint, knip and type honesty are clean.
toISOString()timestamps itself. A sink shared throughAIDD_TELEMETRY_DIRcan still hold lines another writer produced.🔗 Linked issue
Fixes #825
✅ I certify
🤖 Generated with Claude Code
https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb