Skip to content

feat: implement reliable async analytics delivery #101

@coderabbitai

Description

@coderabbitai

Summary

Currently, postRunAnalytics and the root cli.PersistentPostRun use fire-and-forget goroutines (go analytics.PostRunAnalytics(...)) without any synchronization. This is an intentional trade-off — blocking on analytics network I/O made fast CLI commands feel slow — but it means analytics events can be silently dropped when the process exits before the goroutine runs.

Goal

Explore a non-blocking but more reliable delivery mechanism, for example:

  • Buffering events to a local file/queue and flushing them on the next CLI invocation.
  • Using a short, bounded timeout (e.g., 200–500 ms) to allow the goroutine to finish without meaningfully impacting UX.
  • Any other approach that preserves CLI responsiveness while reducing event loss.

Context

Acceptance Criteria

  • Analytics goroutines do not cause noticeable latency increase for fast CLI commands.
  • Event loss rate is reduced compared to the current best-effort approach.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions