Marking event as completed fails silently #556
Labels
in: event publication registry
Event publication registry
meta: waiting for feedback
Waiting for feedback of the original reporter
type: improvement
Minor improvements
When event serialization is misconfigured, it may happen that the
serialized_event
stored in theevent_publication
table will have slightly different value than the serialized event used inEventPublicationRepository#markCompleted
. As a result, even though the event was processed successfully, it is never marked as processed.This is a corner case, but since I've run into it, it may happen that others run into this issue too.
Here's the repository that reproduces the issue: https://github.com/maciejwalkowiak/modulith-mark-as-processed-issue
There are two classes to look at and I tried to explain what happens with comments:
Once you run the test, you'll see in logs where's the problem.
I believe
EventPublicationRepository#markCompleted
should throw an exception if no rows have been updated. This would make our serialization mistake obvious much sooner.The text was updated successfully, but these errors were encountered: