Skip to content

Conversation

@fank
Copy link
Member

@fank fank commented Feb 2, 2026

Summary

Errors from buffered handlers were silently discarded in the goroutine processing loop.

Problem

In withBuffer, the handler was called but its error was ignored:

for e := range buffer {
    h(e)  // Error discarded!
    d.processed.Add(...)
}

This made debugging impossible - even with PR #53 (propagate errors), the errors were never logged.

Fix

Now errors are logged:

_, err := h(e)
if err != nil {
    d.logger.Error("buffered handler failed", "command", command, "error", err)
}

Test plan

  • All dispatcher tests pass

Errors from buffered handlers were silently discarded in the goroutine
processing loop. Now errors are logged, making debugging much easier.
@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/OCAP2/extension/v5/internal/dispatcher 17.52% (-0.24%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/OCAP2/extension/v5/internal/dispatcher/dispatcher.go 17.42% (-0.24%) 924 (+24) 161 (+2) 763 (+22) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

@fank fank merged commit c6352a9 into main Feb 2, 2026
3 checks passed
@fank fank deleted the fix/log-buffered-handler-errors branch February 2, 2026 14:35
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.

2 participants