-
Notifications
You must be signed in to change notification settings - Fork 21
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
One or more errors occurred. (unordered field Item) - This is probably more a question. #51
Comments
Hi, I'll ping @kunjee17 as he is more aware of how Marten works. |
@marcingolenia Hi, I guess we are not yet supporting that type for serialization. Marten is C# library so we have to manually support Serializing type. That we are doing here https://github.com/Dzoukr/CosmoStore/blob/master/src/CosmoStore.Marten/EventStore.fs#L169 . Best way to check is if things are getting serialized without Marten. Means using serializer in isolation. Or you might need to add one more serializer to mix. Currently there are three. DU is supported and I guess it is added by @TheAngryByrd . For your specific DU I m not quite sure. |
FsCodec has a |
@kunjee17 I've tried to do the serialization and deserialization using martenSerializer in isolation like this; let json = EventStore.martenSerializer.ToJson (Dummies.Dummy1 { IncrementedBy = 4 })
let o = EventStore.martenSerializer.FromJson(typeof<Dummies>, new StringReader(json)) and it succeeded... what is strange as I can clearly see that it is passed to marten. |
I've cloned the repo to investigate further. Did you try to build on Linux? I am running ubuntu, after paket restore I run dotnet build and this is what I have; error MSB3202: The project file "/home/mgolenia/projects/CosmoStore/tests/CosmoStore.LiteDb.Tests/CosmoStore.LiteDb.Tests.fsproj" was not found. [/home/mgolenia/projects/CosmoStore/CosmoStore.sln] Ease to fix. After I add existing project I get; Solution file error MSB5023: Error parsing the nested project section in solution file. A project with the GUID "{058D6307-B865-49E9-BF08-A721B1CE3AA7}" is listed as being nested under project "{B0586636-E0F7-438F-B11A-315940D4A108}", but does not exist in the solution. After I removed few guids from the sln I've run into next troubles; could not be found [/home/mgolenia/projects/CosmoStore/src/CosmoStore.LiteDb/CosmoStore.LiteDb.fsproj]
/home/mgolenia/projects/CosmoStore/tests/CosmoStore.TableStorage.Tests.V2/Program.fs(19,13): error FS0074: The type referenced through 'CosmoStore.EventStore' is defined in an assembly that is not referenced. You must add a reference to assembly 'CosmoStore'. [/home/mgolenia/projects/CosmoStore/tests/CosmoStore.TableStorage.Tests.V2/CosmoStore.TableStorage.Tests.V2.fsproj]
/home/mgolenia/projects/CosmoStore/tests/CosmoStore.TableStorage.Tests.V2/Program.fs(33,13): error FS0039: The type 'EventWrite' is not defined. Maybe you want one of the following: Event EventArgs Event`1 Event`2 EventHandler [/home/mgolenia/projects/CosmoStore/tests/CosmoStore.TableStorage.Tests.V2/CosmoStore.TableStorage.Tests.V2.fsproj]
/home/mgolenia/projects/CosmoStore/tests/CosmoStore.TableStorage.Tests.V2/Program.fs(27,13): error FS0039: The record label 'Id' is not defined. [/home/mgolenia/projects/CosmoStore/tests/CosmoStore.TableStorage.Tests.V2/CosmoStore.TableStorage.Tests.V2.fsproj]
/home/mgolenia/projects/CosmoStore/tests/CosmoStore.TableStorage.Tests.V2/Program.fs(36,5): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. [/home/mgolenia/projects/CosmoStore/tests/CosmoStore.TableStorage.Tests.V2/CosmoStore.TableStorage.Tests.V2.fsproj]
/home/mgolenia/projects/CosmoStore/tests/CosmoStore.CosmosDb.Tests.V2/Program.fs(19,15): error FS0074: The type referenced through 'CosmoStore.EventStore' is defined in an assembly that is not referenced. You must add a reference to assembly 'CosmoStore'. [/home/mgolenia/projects/CosmoStore/tests/CosmoStore.CosmosDb.Tests.V2/CosmoStore.CosmosDb.Tests.V2.fsproj]
/home/mgolenia/projects/CosmoStore/tests/CosmoStore.CosmosDb.Tests.V2/Program.fs(34,13): error FS0039: The type 'EventWrite' is not defined. Maybe you want one of the following: Event EventArgs Event`1 Event`2 EventHandler [/home/mgolenia/projects/CosmoStore/tests/CosmoStore.CosmosDb.Tests.V2/CosmoStore.CosmosDb.Tests.V2.fsproj]
/home/mgolenia/projects/CosmoStore/tests/CosmoStore.CosmosDb.Tests.V2/Program.fs(28,13): error FS0039: The record label 'Id' is not defined. [/home/mgolenia/projects/CosmoStore/tests/CosmoStore.CosmosDb.Tests.V2/CosmoStore.CosmosDb.Tests.V2.fsproj]
/home/mgolenia/projects/CosmoStore/tests/CosmoStore.CosmosDb.Tests.V2/Program.fs(37,5): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. [/home/mgolenia/projects/CosmoStore/tests/CosmoStore.CosmosDb.Tests.V2/CosmoStore.CosmosDb.Tests.V2.fsproj] So I have removed LiteDb implementation + tests, TableStorage.V2.Tests + CosmosStore.CosmosDb.Tests.V2. |
@marcingolenia It seems to be dotnet issue. All projects are still on v3. And if you are installing latest dotnet core then it would be on 5. I have developed all implementation on Mac. So, OS should not be issue if dot net core is supported there. |
Hi, {
"sdk": {
"version": "3.1.404"
}
} And the issues are still there. After I did the things I've already mentioned I tried to run fake with TestMarten target and this happens: Stack overflow.
Finished (Failed) 'TestMarten' in 00:00:07.2201011 Can one of the authors look into this? If it is not straightforward can I count on contribution guide? How to build/test at least. Now I cannot do it using CLI or Rider IDE. |
@marcingolenia have you check the connection for poatgres ? If that is working? |
I did not, I would do it in case of SocketException from NpgsqlConnector, not overflow. Would You accept a PR with;
|
cc/ @Dzoukr . I guess I m ok with improvement. I haven't touch the code since ages. These seems good improvement. |
Yup, any improvement is more than welcome. :) |
I'm having the exactly same issue. If we can't use discriminated unions for events, thats at last for me a major drawback. How could this be fixed? Googling for "unordered field Item" this is the only hit, yeah. |
@yankun it is mostly serialization issue. You can use different strategy to overcome this. Just search of F# union object json serialization. if I remember correctly there is F# specific wrapper around JSON.net and one blog post in fsharpforfunandprofit on this as well. |
Hi there!
I am looking for an event store which will be friendly to F#, so the one written in F# should be perfect ;D I tried to use it with postgres + marten, but I am failing to read events if they are represented by discriminated union. Let me just give You the test that I run;
The test breaks on event read.
So it is quite mysterious. Probably I am doing something wrong.
Without DU it works just OK - so if we will use
EventWrite<DummyEvent>
Any hints? Thanks guys in advance!
The text was updated successfully, but these errors were encountered: