question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

One or more errors occurred. (unordered field Item) - This is probably more a question.

See original GitHub issue

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;

module Tests

open System
open System.Threading.Tasks
open Xunit
open CosmoStore.Marten
open CosmoStore
open FsUnit.Xunit

type DummyEvent = { IncrementedBy: int }
type DummyEvent2 = { Date: DateTime }
type Dummies =
    | Dummy1 of DummyEvent
    | Dummy2 of DummyEvent2

[<Fact>]
let ``Saving and reading`` () =
    // Arrange
    let streamId = "MyAmazingStream"

    let config: Configuration =
        { Host = "localhost"
          Username = "postgres"
          Password = "Secret!Passw0rd"
          Database = "cativity" }

    let es = EventStore.getEventStore config

    let eventWrite: EventWrite<Dummies> =
        { Id = Guid.NewGuid()
          CorrelationId = None
          CausationId = None
          Name = nameof DummyEvent
          Data = Dummies.Dummy1{ IncrementedBy = 4 }
          Metadata = None }
    // Act + Assert
    [ eventWrite ]
        |> es.AppendEvents streamId ExpectedVersion.Any
        |> Async.AwaitTask
        |> Async.RunSynchronously
        |> ignore
    let events =
        EventsReadRange.AllEvents
        |> es.GetEvents "MyAmazingStream"
        |> Async.AwaitTask
        |> Async.RunSynchronously
    [ events.Head.Data ] |> should equal [ eventWrite.Data ]

The test breaks on event read.

System.AggregateException
One or more errors occurred. (unordered field Item)

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!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Dzoukrcommented, Jun 15, 2021

Yup, any improvement is more than welcome. 😃

1reaction
kunjee17commented, Jun 15, 2021

cc/ @Dzoukr .

I guess I m ok with improvement. I haven’t touch the code since ages. These seems good improvement.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSRS Query execution failed for dataset - sql server
I enabled remote errors to pinpoint the problem. I identified that a column in a particular dataset (one of my views) was throwing...
Read more >
Top 10 questions and answers about SQL Server Indexes
In this blog post you will find top 10 most asked questions and a few that should be asked but often are not,...
Read more >
How To Fix pandas.parser.CParserError: Error tokenizing ...
The most obvious solution to the problem, is to fix the data file manually by removing the extra separators in the lines causing...
Read more >
Common Store Errors
This error message means ShipStation has communicated with your store but the data is missing one or more required values. Possible solutions:.
Read more >
Chapter 3. Data, Tables, and Database Design
Put repeated items into separate tables. If your customer has two or more phone numbers, you should create distinct phone number fields in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found