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

Snapshotting 2 Aggregates having same identity #544

Open
pirvudoru opened this issue Dec 15, 2023 · 0 comments
Open

Snapshotting 2 Aggregates having same identity #544

pirvudoru opened this issue Dec 15, 2023 · 0 comments

Comments

@pirvudoru
Copy link

pirvudoru commented Dec 15, 2023

Not sure if this is the right place for the issue but, i have the following aggregates:

  • MyApp.AModule.Aggregates.Foo
  • MyApp.BModule.Aggregates.Bar

The identity is shared, so the same identity (say 52b439d4-cd86-4a09-a935-5c9227e1b1af) can correspond to Foo and also a Bar aggregate instance.

With snapshotting disabled, everything works well.
If i enable snapshotting on one aggregate, everything works well.
When I enable snapshotting for both of them, I receive errors like:

lib/myapp/bmodule/aggregates/bar.ex:13: MyApp.BModule.Aggregates.Bar.execute(%MyApp.AModule.Aggregates.Foo{}, %MyEvent{})

Somehow the snapshot is not stored per type + identity, but only for identity.

How can i enable snapshotting on both aggregate types without Commanded getting confused about which type of snapshot it needs to load?

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