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

Aggregate throws error when execute returns more than 1000 events. #554

Open
thomasdziedzic opened this issue Mar 23, 2024 · 0 comments
Open

Comments

@thomasdziedzic
Copy link

I have the following pseudo code:

defmodule Aggregate
  def execute(_state, cmd) do
    cmd.lots_of_events
    |> Enum.take(1000)
  end
end

Which works as expected, but when I try taking 1001:

defmodule Aggregate
  def execute(_state, cmd) do
    cmd.lots_of_events
    |> Enum.take(1001)
  end
end

I get an error:

[debug] Appended 1000 event(s) to stream "0"
[warning] Failed to append events to stream "0" due to: :duplicate_stream_uuid
[debug] Appended 1000 event(s) to stream "0"
[warning] Failed to append events to stream "0" due to: :duplicate_stream_uuid
** (MatchError) no match of right hand side value: {:error, :already_retried_once}

This is on a brand new database (reproduced it right after running mix do ecto.drop, ecto.create, ecto.migrate, event_store.create, event_store.init)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant