Event Sourcing: undo set-remove-based bi-temporal events – because we must
Part thirteen of an event sourcing series tackles the problem of undoing events in a bi-temporal, set-remove-based model. The naive approach of overriding a wrong event with the same timestamp corrupts the timeline when subsequent events are added. Two solutions are compared: a simpler approach using 'undone' and 'undoneAt' columns to mark events as undone without losing historical meaning, and a more complex 'Undo event' approach that references events by effective and application timestamps. The author explains why the column-based approach is preferred for its simplicity and maintainability, and includes an F# code deep dive showing the implementation for a task-tracking feature.