I suspect there’s nothing in EventStore specifically supporting the following pattern, but maybe someone could offer their input on how to best accomplish a similar thing, or other patterns to use instead.
In our test environments, we sometimes find that events make it in to the system that should not be there, and may break the current data contract and invariants for our event types. If this happens in production we ensure that the system can deal with it, but for development it’s often easier to just scrap the events and start fresh.
Since our staging environment has a significant amount of data however, this is easier said than done. We can’t simply delete individual events so end up either dropping lots of existing test data, or copying over events from an old namespace prefix to a new.
Ideally we would have something that provides the same result as copying all events in a category minus the last few offending ones, without actually having to take the time and disk to copy the data - something like spawning off new events from a known good point in time, and make it transparently look like an entire new stream with the same data.
Is it possible to do something like this with projections or other means? It would need to copy/link events from a source stream up to a point, but then let go of the stream so that events could be appended to it manually.