Steps to reproduce:
- Setup throwing an exception in
IDocumentStore.OnBeforeDelete, e.g. store.OnBeforeDelete += (_, _) => throw new Exception();
- Attempt to delete an existing record, e.g. by calling
DbSession.Delete("Tickets/1-A")
- The record in the DB remains untouched thanks to the exception in the
OnBeforeDelete
- However,
await DbSession.Advanced.ExistsAsync("Tickets/1-A")would return false.
- Though, if call
DbSession.Advanced.Clear() first then ExistsAsync would return true.
See a relevant test in the YABT project.
Steps to reproduce:
IDocumentStore.OnBeforeDelete, e.g.store.OnBeforeDelete += (_, _) => throw new Exception();DbSession.Delete("Tickets/1-A")OnBeforeDeleteawait DbSession.Advanced.ExistsAsync("Tickets/1-A")would returnfalse.DbSession.Advanced.Clear()first thenExistsAsyncwould returntrue.See a relevant test in the YABT project.