Skip to content

fix: apply backward-compat rule for empty EventType in buildReportData#434

Merged
claude[bot] merged 1 commit intomainfrom
claude/issue-431-20260301-2015
Mar 1, 2026
Merged

fix: apply backward-compat rule for empty EventType in buildReportData#434
claude[bot] merged 1 commit intomainfrom
claude/issue-431-20260301-2015

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Mar 1, 2026

Summary

buildReportData in cmd/report.go was silently discarding activitylog.Entry values where EventType is empty (the zero value), treating them as non-EventRun events.

This applies the same backward-compatibility rule already used in activitylog.ReadAll(): treat an empty EventType as EventRun.

Changes

  • cmd/report.go: added backward-compat check inside buildReportData before the EventType filter

Fixes

5 failing tests in cmd/report_test.go:

  • TestBuildReportData_SnapshotCount
  • TestBuildReportData_TotalBytes
  • TestBuildReportData_TokenEstimation
  • TestBuildReportData_HoursEstimation
  • TestBuildReportData_CompactionCount

Closes #431

Generated with Claude Code

Entries with empty EventType (created in tests or old log files without
event_type) were silently discarded by buildReportData. Apply the same
backward-compat rule already used in ReadAll: treat empty EventType as
EventRun.

Fixes 5 failing report tests that construct entries without EventType.

Co-Authored-By: Grey Newell <greyshipscode@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com>
@claude claude bot merged commit 12b15e8 into main Mar 1, 2026
1 check passed
@claude claude bot deleted the claude/issue-431-20260301-2015 branch March 1, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: buildReportData drops entries without EventType, causing 5 report tests to fail

0 participants