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

Journal restore fills command fields with null #126

Open
srid opened this issue Mar 23, 2021 · 1 comment
Open

Journal restore fills command fields with null #126

srid opened this issue Mar 23, 2021 · 1 comment
Assignees

Comments

@srid
Copy link

srid commented Mar 23, 2021

I have a repro for this. This F# project: https://github.com/srid/Baseline (dotnet run the Baseline.CLI project)

When I run the program multiple times, each time it loads the .journal file (which seems to be created correctly) but discards the command field values in them, instead filling them with null. See terminal output:

image

As you can see all but the last record (which was inserted in current thread) is filled with null. All but last record was loaded from the .journal file at program startup.

The command itself looks about right:

type Think(s: string, t: DateTime) =
    inherit Command<BaselineModel, DateTime>()

    member this.Content = s
    member this.When = t
    
    override Command.Execute(model: BaselineModel): DateTime =
        let thought = model.Think(s, t)
        Command.RaiseEvent(ThoughtSaved(thought))
        thought.When

Did I hit a bug in memstate?

@srid
Copy link
Author

srid commented Mar 23, 2021

In another project (a solution with exactly one project with exactly one module), it works: https://github.com/srid/OneBird/blob/master/Program.fs

I wonder if it is something to do with the multiple project / split-across-modules nature of the Baseline project that causes this bug? I do see that in the .journal file the module/namespace is registered, along with project name.

@rofr rofr self-assigned this Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants