Repository navigation
fix(telemetry): an empty worktree id in the journal reads as not stated - #828
Merged
Merged
Conversation
parseWorktree's comment promised that a torn or empty worktree_id reads as "not stated", on the ground that asString rejects "". It does not: a session_start carrying "worktree_id": "" was read as a worktree named nothing. An empty value is now dropped like an absent one, for the repo id too, and the comment says what the code does. Two tests, the first ones the worktree fields ever had: an empty id and repo id read as absent (red before the change), and stated ones are kept as written (red with both dropped unconditionally). Fixes #826 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
parseWorktreein the run-journal reader promised, in its comment, that a torn or emptyworktree_idreads as "not stated", becauseasStringrejects"". The adapter'sasStringreturns any string, so asession_startcarrying"worktree_id": ""was read as a worktree named nothing. The worktree fields had no test at all.🛠️ How it works
worktree_idorworktree_repo_idis now dropped like an absent one:asString(...) || undefined.🧪 How to verify
Telemetry suite: 56 files, 852 tests passed. Typecheck, lint, test:arch, knip and type honesty are clean.
Not reached in practice today, because the journal hook never writes an empty worktree id. The fix makes the reader keep the promise its comment already made, which was the recommended option in #826.
🔗 Linked issue
Fixes #826
✅ I certify
🤖 Generated with Claude Code
https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb