Skip to content

V2.39.1

Choose a tag to compare

@jeremydmiller jeremydmiller released this 04 Aug 12:44
· 599 commits to main since this release

A single fix on top of 2.39.0.

EventProjection teardown (#626)

JasperFxEventProjectionBase's constructor never touched Options, so an EventProjection registered no teardown targets — Options.CleanUps and Options.StorageTypes stayed empty unless the author hand-called Options.DeleteViewTypeOnTeardown<T>(). Aggregation projections have always registered their single TDoc, and nothing in the API surface signalled the difference.

Everything that derives "what does this projection own" from those lists silently did nothing for event projections: a rebuild deleted the progression row and then re-projected into a table still holding the previous run's documents, per-tenant progression deletion left the documents behind, and the ProjectionScenario harness wipe never wiped after an event projection.

Published types are now registered as teardown targets in AssembleAndAssertValidity() rather than the constructor — the source generator emits its RegisterPublishedType calls into the subclass constructor, which runs after the base one, so only assembly time sees the complete set. Registration is idempotent.

Behavior change

Rebuilding an event projection now truncates the document types it publishes. That is the point of the fix, but if a projection writes into storage it doesn't own — an append-only audit table, or documents another projection owns — set the new opt-out:

public class MyProjection : EventProjection
{
    public MyProjection()
    {
        DeletePublishedTypesOnTeardown = false;
    }
}

It is all-or-nothing: turn it off and call Options.DeleteViewTypeOnTeardown<T>() for the types you do want wiped.

Because DeleteViewTypeOnTeardown writes to both CleanUps and StorageTypes, the ProjectionScenario test-harness wipe also starts working after event projections. Desirable, and now deliberate rather than incidental.

What's Changed

Full Changelog: V2.39.0...V2.39.1