Skip to content

Commit

Permalink
resource-directory/projection: fix processing snapshot with older ver…
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
jkralik committed May 5, 2022
1 parent 9db3ece commit 9717e57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resource-aggregate/cqrs/eventstore/projection.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ func (am *aggregateModel) Update(e EventUnmarshaler) (ignore bool, reload bool)
am.LogDebugfFunc("projection.aggregateModel.Update: am.GroupID %v: AggregateID %v: Version %v, hasSnapshot %v", am.groupID, am.aggregateID, am.version, am.hasSnapshot)

switch {
case e.Version() == 0 || e.IsSnapshot():
am.LogDebugfFunc("projection.aggregateModel.Update: e.Version == 0 || e.IsSnapshot()")
case e.Version() == 0 || (e.IsSnapshot() && (!am.hasSnapshot || e.Version() > am.version)):
am.LogDebugfFunc("projection.aggregateModel.Update: e.Version == 0 || (e.IsSnapshot() && (!am.hasSnapshot || e.Version() > am.version)")
am.version = e.Version()
am.hasSnapshot = true
case am.version+1 == e.Version() && am.hasSnapshot:
Expand Down

0 comments on commit 9717e57

Please sign in to comment.