eventsource icon indicating copy to clipboard operation
eventsource copied to clipboard

err from loadVersion should not be discarded in Apply

Open metaleap opened this issue 2 years ago • 0 comments

Culprit: https://github.com/altairsix/eventsource/blob/7b6859b7a00908296beea99d5d2800b6c071c084/repository.go#L187

loadVersion can fail for reasons other than "not found", such as "store implementation has connectivity outage" etc. You do not want to discard such errs and fall back on a newly-instantiated empty aggregate here...

A fix to this would do so only for errs of type eventsource.Error with a Code() of eventsource.ErrAggregateNotFound I reckon? --- with all other errs being properly returned immediately.

metaleap avatar Jul 08 '22 11:07 metaleap