Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weakly-typed actors should support polymorphic response and null response #1213

Closed
RemcoBlok opened this issue Dec 13, 2023 · 0 comments · Fixed by #1214
Closed

Weakly-typed actors should support polymorphic response and null response #1213

RemcoBlok opened this issue Dec 13, 2023 · 0 comments · Fixed by #1214
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@RemcoBlok
Copy link
Contributor

RemcoBlok commented Dec 13, 2023

Expected Behavior

  1. In .NET 7.0 or later an operation on an actor invoked using a weakly-typed actor client should support a polymorphic response. The response json should include a type discriminator property to allow for polymorphic deserialization by the actor client. The weakly-typed actor client must polymorphically deserialize the response when invoking InvokeMethodAsync<ResponseBase> on the weakly-typed actor client. This should yield a DerivedResponse instance. Note that invoking InvokeMethodAsync<DerivedResponse> is not polymorphic deserialization.
  2. An operation on an actor invoked using a weakly-typed actor client should support a null response.

Actual Behavior

  1. The response json does not include a type discriminator. The deserialized response is an instance of the base response class, not the derived response class.
  2. A null reference exception is thrown by the ActorManager.DispatchWithoutRemotingAsync method.

Steps to Reproduce the Problem

  1. Declare an operation on an actor interface whose declared return type is a base class called ResponseBase. Implement the operation on an actor. The implementation returns an instance of a derived class called DerivedResponse. Invoke the operation using a weakly-typed actor client using the InvokeMethodAsync<ResponseBase> method (not using InvokeMethodAsync<DerivedResponse>).
  2. Return null from an actor operation invoked using a weakly-typed actor client.

Release Note

  1. RELEASE NOTE: Weakly-typed actor supports polymorphic response in .NET 7 or later.
  2. RELEASE NOTE: Weakly-typed actor supports null response.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants