Skip to content

fix(telemetry): resolve 15 latent bugs across telemetry modules#31

Open
deer wants to merge 2 commits intomainfrom
telemetry
Open

fix(telemetry): resolve 15 latent bugs across telemetry modules#31
deer wants to merge 2 commits intomainfrom
telemetry

Conversation

@deer
Copy link
Copy Markdown
Collaborator

@deer deer commented Apr 2, 2026

Fixes 15 of 18 bugs from the telemetry bug analysis. Three required no code change: BUG-15 (ANSI cursor N+1) is intentional and load-bearing — documented in ANSIBasedTelemetryRecorder.render(); BUG-16 (render thread interrupt handling) was correct
as-is — re-interrupting would cause a busy-loop since the exit condition is renderFuture.isDone(), not the interrupt flag, also documented. BUG-10 (Meter.progress() race) is left unfixed with a comment — narrow window, minor consequence.

base-telemetry

  • Null format guard in all 10 create() factories (BUG-2)
  • Fixed Completed.toString() time arithmetic for durations >1 day — was subtracting adjusted hours from total minutes instead of using % (BUG-8)
  • Removed stray null from TelemetryRecorder.diagnostic(Location, ...) that always caused NPE (BUG-11)
  • Javadoc corrections in TextualRange.start() and Commenced.create() (BUG-1, BUG-7)

base-telemetry-foundation

  • Fixed double-formatting of description in AbstractTelemetryRecorder.commence() — description was formatted once then passed as a format string again to Commenced.create() (BUG-9)
  • ObservableTelemetryRecorder.uri() now returns the stored URI instead of delegating to the wrapped recorder (BUG-13)
  • stream() and hasObserved() now take a snapshot under lock and traverse outside it — prevents ConcurrentModificationException without blocking recording threads during predicate evaluation (BUG-12)
  • PrintStreamTelemetryRecorder now routes Fatal and Warning to errorStream (BUG-14)

base-telemetry-ansi

  • ProgressBar counter now clamps to [0, total] on each delta, eliminating negative percentages and >100% display (BUG-4, BUG-5)
  • close() sets counter to total before removal so the bar always renders at 100% on close (BUG-6)
  • Explicit total == 0 guard replacing silent NaN→int cast (BUG-3)
  • remove() now clears the activity list before calling render() to prevent blank-line flicker on last removal (BUG-17)
  • message field made final (BUG-18)

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