F# Discriminative Unions not serializing correctly when being returned from grains
- Dominant language
- C#
- Stars
- 10.9k
- Forks
- 2.1k
- Avg merge
- 14h 42m
- Merged PRs (30d)
- 354
Description
I believe there is an issue with the fsharp discrimitive unions and the orleans dotnet 9 grain serializer
Here is a repo were this can be reproduced
https://github.com/WesleySkeen/orleans-fsharp-dotnet9/tree/main
I have this type that gets returned from the grain

Here is the grain interface and its implementation

I have hardcoded the result to demonstrate the issue.
I believe the issue lies in the `responseCopier` of the `GrainMethodInvoker` class
Here is the response before the `responseCopier` function gets called

and here is the result after

As you can see, the content of the discrimitive union is now null
Contributor guide
Research direction
Start with the linked reproduction repository and inspect GrainMethodInvoker, focusing on the responseCopier path described in the report. Reproduce the grain call with the discriminated-union response, compare the value before and after copying, and consider the issue complete when the returned union retains its content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, fsharp
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100