Skip to content

Add telemetry with improved reliability - #26

Merged
brianlovin merged 1 commit into
mainfrom
brianlovin/telemetry
Jan 26, 2026
Merged

Add telemetry with improved reliability#26
brianlovin merged 1 commit into
mainfrom
brianlovin/telemetry

Conversation

@brianlovin

Copy link
Copy Markdown
Owner

Summary

Implement anonymous usage telemetry with production-ready reliability improvements. Fixes all issues identified in code review: concurrent flush race conditions, unbounded retries on server failures, high exit shutdown timeouts, and redundant navigation event tracking.

Changes

  • Race condition prevention: Added isFlushing guard to prevent concurrent flush calls
  • Failure tracking: Track consecutive failures and stop retrying after 3 attempts
  • Faster shutdown: Use 1.5s timeout on app exit instead of 5s
  • Optimized tracking: Removed high-frequency j/k navigation events (redundant with story_selected)
  • Comprehensive tests: Added 3 new tests for auto-flush, concurrency, and failure limits

🤖 Generated with Claude Code

Implement anonymous usage telemetry with race condition prevention, failure tracking, and comprehensive tests:
- Add flushing guard to prevent concurrent flush calls
- Track consecutive failures and stop retrying after 3 attempts
- Use shorter 1.5s timeout on app exit instead of 5s for faster shutdown
- Remove high-frequency j/k navigation tracking (redundant with story_selected)
- Add tests for auto-flush threshold, concurrent flush prevention, and failure limits
- Include documentation in README and CLAUDE.md with opt-out instructions

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@brianlovin
brianlovin merged commit aee9b3b into main Jan 26, 2026
1 check passed
@brianlovin
brianlovin deleted the brianlovin/telemetry branch January 26, 2026 15:22
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.

1 participant