Skip to content

v1.2.0: startup validation, OpenTelemetry, scope-per-dispatch - #1

Merged
nifragos merged 1 commit into
mainfrom
feature/1.2-validation-telemetry-scopes
Sep 13, 2026
Merged

nifragos merged 1 commit into
mainfrom
feature/1.2-validation-telemetry-scopes

Conversation

@nifragos

Copy link
Copy Markdown
Contributor

Summary

  • ValidateSwitchboard(): startup validation that reports requests with no handler, requests with several, and open behaviors silently skipped for void requests because they're constrained to IRequest<TResponse>. It reads registrations only and never constructs a handler.
  • OpenTelemetry built in: spans for Send/Publish/each notification handler, plus switchboard.request.duration and switchboard.notification.duration histograms, via ActivitySource/Meter (no new dependency).
  • UseScopePerDispatch(): a DI scope per top-level dispatch for Blazor Server. Nested dispatches reuse it, and a callback carries ambient state such as the current user.
  • Fix: calling AddSwitchboard twice on the same assembly no longer registers handlers and behaviors twice (notification handlers used to run twice).
  • Tests for constrained behaviors; README gains a "Beyond MediatR" section.

Test plan

  • 59 tests pass on net10 locally
  • CI runs the suite on net8/net9/net10
  • ATLAS builds and passes validation against a local 1.2.0 package

…istrations; v1.2.0

- ValidateSwitchboard(): reports missing and duplicate handlers, and open behaviors
  that silently skip void requests (the IRequest<TResponse> constraint trap)
- Built-in tracing and metrics via ActivitySource/Meter (no new dependency)
- UseScopePerDispatch(): a DI scope per top-level Send/Publish, nested dispatches
  reuse it, with a callback to carry ambient state (Blazor Server)
- Fix: AddSwitchboard called twice on the same assembly no longer registers
  handlers and behaviors twice
- Tests for constrained behaviors; README documents all of the above
@nifragos
nifragos merged commit 9e34a6d into main Sep 13, 2026
2 checks passed
@nifragos
nifragos deleted the feature/1.2-validation-telemetry-scopes branch September 13, 2026 14:20
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