Write to soft-deleted stream with expectedVersion - How to get the lastEventNumber?

Hi everyone,

I am currently stuck trying to write to a previously soft-deleted stream.

  • We are using a non-admin user that has all permissions to read and write the stream and the metadata itself. ACLs are applied.

  • If we try to append messages with expectedVersion and expect the stream to be empty or non-existent, we get the WrongExpectedVersion error

How can we find out what the last event number was, so that we can properly set the expected version?

Thanks for your help and regards

Cedric