docs: fix README errors and document generic notification handlers (v2.1.2)#49
Merged
Conversation
…docs (v2.1.2) Agent-Logs-Url: https://github.com/hasanxdev/DispatchR/sessions/bf9f2dea-964c-4768-b4e7-31ae7fb7ea59 Co-authored-by: hasanxdev <30981174+hasanxdev@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
hasanxdev
May 8, 2026 18:54
View session
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Documentation-focused update to correct README examples and describe the new open-generic notification handler pattern introduced in v2.1.2, plus a clarification about request return types in DispatchR.
Changes:
- Fix incorrect
IStreamRequest<,>and stream handler type parameters in README examples. - Correct a misplaced notification section heading and add documentation/example for open-generic
INotificationHandler<TNotification>. - Add an
[!IMPORTANT]callout about requestTResponsereturn types when pipelines/validators are involved.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ``` | ||
|
|
||
| > [!IMPORTANT] | ||
| > Always use a **generic** return type such as `Task<TResult>` or `ValueTask<TResult>`. Using a bare `Task` or `ValueTask` (without a type argument) may prevent the handler from being triggered when pipeline behaviors or validators are present. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several README examples contained incorrect type parameters and a misplaced section heading. Issue #44 also surfaced a missing clarification about
IRequestreturn types when validators/pipelines are involved.Fixes
IStreamRequest<PingDispatchR, ValueTask<int>>→IStreamRequest<CounterStreamRequestDispatchR, int>(element type must not be wrapped inValueTask; self-reference type was wrong)CounterStreamHandlerDispatchR→CounterStreamRequestDispatchR)Clarification (Issue #44)
Added an
[!IMPORTANT]callout under Request Definition:TResponsemust always be a generic wrapper (Task<T>/ValueTask<T>). Using bareTaskorValueTasksilently breaks handler dispatch when pipeline behaviors or validators are present.New: Generic Notification Handlers (v2.1.2)
Added docs and example for the open-generic
INotificationHandler<TNotification>pattern released in v2.1.2:Updated the "Currently supports" list to include this third notification variant.