Closed asoeters closed 4 months ago
After archiving the projection is still queryable after archiving.
await using (var session = store.LightweightSession()) { id = session.Events.StartStream<ValueDto>(new Add("test"), new Edit("edit")).Id; session.SaveChanges(); } await store.WaitForNonStaleProjectionDataAsync(20.Seconds()); await using (var session = store.QuerySession()) { var state = session.Query<ValueDto>().FirstOrDefault(x => x.Id == id); } await using (var session = store.LightweightSession()) { session.Events.ArchiveStream(id); } await store.WaitForNonStaleProjectionDataAsync(20.Seconds()); await using (var session = store.QuerySession()) { var currentState = await session.Events.FetchStreamStateAsync(id); //This returns a true for archive var state = session.Query<ValueDto>().FirstOrDefault(x => x.Id == id); //This return the full object. }
I created a small repro project: https://github.com/asoeters/MartenArchive
Archiving a stream is just a marker in the system. It has impact on projection rebuilds, and will hopefully be part of future plans to shard the events table. What you're seeing is as designed.
After archiving the projection is still queryable after archiving.
I created a small repro project: https://github.com/asoeters/MartenArchive