Skip to content

Compliance suite: FetchLatest / ProjectLatest across projection lifecycles #5138

Description

@jeremydmiller

Part of #5118 (compliance wave growth), epic #5110.

FetchLatest<T> and ProjectLatest<T> are declared on the shared JasperFx.Events.IEventStoreOperations (FetchLatest<T>(Guid|string), FetchLatest<T, TId>(TId), ProjectLatest<T>(Guid|string)), so this suite is portable with no seam addition.

The behavior is subtle enough to be worth pinning cross-store: FetchLatest has to give the same answer regardless of whether the aggregate is Live, Inline or Async, which means folding unsaved-but-appended events on top of a persisted snapshot, and reading through the identity map when one is in play.

What each store tests today

Marten Polecat
EventSourcingTests/Projections/project_latest_tests.cs Events/fetch_latest_tests.cs
Aggregation/when_finding_the_last_good_aggregation.cs Events/project_latest_tests.cs
EventSourcingTests/FetchForWriting/* (FetchLatest cases) Events/use_identity_map_for_aggregates.cs

Scope

New FetchLatestCompliance suite:

  1. FetchLatest against Live, Inline and Async registration of the same aggregate returns identical state
  2. FetchLatest after appending in the same uncommitted session sees the pending events
  3. FetchLatest returns null for an unknown stream, and for a stream whose aggregate folds to null
  4. ProjectLatest vs FetchLatest divergence (projection-vs-storage read) is asserted explicitly rather than assumed
  5. Repeated FetchLatest in one session returns the same instance where an identity map is in play, and a fresh instance where it is not
  6. Guid and string stream identity

Acceptance

  • Suite enrolled in both stores, zero capability gates
  • Originals retired in both repos

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions