akkadotnet / akka.net

Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
http://getakka.net
Other
4.7k stars 1.04k forks source link

"Doesn't match" exception Akka.Persistence.FSharp #3882

Open eranikid opened 5 years ago

eranikid commented 5 years ago

I am trying to get PersistenceExample.FsApi running. I am using the very same code, but I get following exception:

Unhandled Exception: System.Exception: Doesn't match
   at Akka.Persistence.FSharp.Linq.PersistentExpression.ToExpression[Command,Event,State](Expression`1 f)
   at Akka.Persistence.FSharp.spawnPersist[Command,Event,State](IActorRefFactory actorFactory, String name, Aggregate`3 aggregate, FSharpList`1 options)
   at Program.Scenario0.run() in Program.fs:line 33
   at <StartupCode$FSharpAkka>.$Program.main@() in Program.fs:line 94

I am using Akka and Akka.Persistence.FSharp version 1.3.14, target framework is netcoreapp2.2, OS is Windows 10.

Did the example went out of sync?

bromanko commented 5 years ago

I'm also encountering this. Did you get a resolution?

bromanko commented 5 years ago

The comment in this issue gives an alternative spawn function that does not have this issue. I've been using that successfully.

Aaronontheweb commented 5 years ago

The example must be out of sync, by the looks of it - I'd love a pull request there

bromanko commented 5 years ago

I don't think it's the examples. The example calls spawnPersist as I would expect. The problem is that spawnPersist doesn't pattern match. I'm not sure if this is due to a recent change in F#.

The code snippet in the comment on #3465 is an alternative implementation of spawnPersist. I think that these functions need to be updated in the FSharp.Persistence library to work.

I can attempt to get things running locally and writing a regression test for the issue. But I'm not sure this is good-for-first-time-contributors.