Deleted streams vs subscription to all

Hi,

After deleting a stream with hard delete, events from deleted stream still appears in EventHandler with subscription to all.
What I’m doing wrong?

Stream delete returns some position (no failure)
await connection.DeleteStreamAsync(streamName, aggregateRoot.Version, true, this.eventStoreConnectionProvider.UserCredentials);

$all is a special read it doesn’t check deleted etc. The events will be removed at next scavenge

Might be worth adding an option to filter deleted events.

But let’s not forget, it may not scavenge unless you set AlwaysKeepScavenged. This cost my client a ton of time, I wish it was a more common first response to these issues Greg.

Ah yes, if a chunk is calculated as not getting smaller it will skip the scavenge. The best pattern for working around this is to write an explicit “stream deleted” event. Then your readers can take appropriate actions, the scavenge will then later remove things.

In my point of view deleting is worthless if events are still sent to event handlers.
Something like a flag in ResolvedEvent could be enough for me.

BTW. It could be nice to have subscription to all working only with valid domain events, so without deleted events, $stats, $projections or any other technical streams

You can do this yourself.

Write a projection

fromAll().

when(

$any : function() { linkTo(‘myAll’, e)}

)

Will it be a good, production quality solution from performance and stability perspective?

Scavenge is just a http post (requires admin rights). might be worth adding something similar to https://github.com/EventStore/EventStore/tree/release-v4.0.3/src/EventStore.ClientAPI/UserManagement for it.

According to documentation:
“Scavenges only affect completed chunks, so deleted events in the current chunk will still be there after you run a scavenge”

Are they any plans to improve this?

I am not sure what “improvement” you would be looking for. The chunk size is configurable.

Normally I’m expecting that after using DeleteStream method in API, events will be simply deleted,

without playing with anything else.

At least I would like to recognise deleted events in subscription’s event handler.