Skip to content

backport: Merge PR #8231 — fix: RejectOnType<TMessage> should use Rejection, not Failure - #8232

Merged
Aaronontheweb merged 1 commit into
akkadotnet:devfrom
Aaronontheweb:backport/reject-ontype
Jun 3, 2026
Merged

Aaronontheweb merged 1 commit into
akkadotnet:devfrom
Aaronontheweb:backport/reject-ontype

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Member

Description

Backport of #8231 to .

Fixes the bug where in was incorrectly calling , causing the journal to crash instead of rejecting messages of the specified type.

  • now correctly delegates to which uses the interceptor
  • Added regression tests covering both matching and non-matching type behavior
  • Changed from to to support typed message tests

Changes

  • 3 files changed, 35 insertions(+), 7 deletions(-)

…tnet#8231)

* fix: RejectOnType<TMessage> should use Rejection, not Failure

The generic RejectOnType<TMessage>() was incorrectly calling FailOnType,
causing the journal to crash instead of rejecting. Fixed to delegate
to RejectOnType(Type) which uses the correct Rejection interceptor.

* test: add regression tests for RejectOnType<T>()

- RejectOnType<TMessage>() should reject matching types, not fail
- Non-matching types should still pass through normally
- This prevents the bug where RejectOnType<T>() was calling FailOnType

Closes akkadotnet#8231

* test: add regression tests for RejectOnType<T>()

- PersistActor.WriteMessage.Data changed from string to object to support typed messages
- RejectOnType<T> matching types are rejected (not failed)
- RejectOnType<T> non-matching types pass through normally

Fixes the bug where RejectOnType<TMessage>() was calling FailOnType instead of RejectOnType(Type)
@Aaronontheweb
Aaronontheweb merged commit befa586 into akkadotnet:dev Jun 3, 2026
11 checks passed
@Aaronontheweb
Aaronontheweb deleted the backport/reject-ontype branch June 3, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant