Skip to content

0.9.0

Choose a tag to compare

@jeremydmiller jeremydmiller released this 17 Aug 23:20
· 3 commits to main since this release
9eab507

The JasperFx 2.51.0 wave — three issues, one PR each, and Fisher is now green on all 36 shared compliance suites (309 tests) for the first time.

The aggregate write cache (#97)

jasperfx#674 moved IAggregateWriteCache into JasperFx.Events, so Marten, Polecat and Fisher share one second-level snapshot cache behind FetchForWriting instead of a consumer targeting all three writing one per flavour.

opts.Events.CacheAggregatesForWriting<Order>();          // off for every type by default
opts.Events.AggregateWriteCaching.Cache = myOwnCache;    // or bring your own

Grade 1 only: the cached snapshot is a baseline. The stream version and every event after the cached one are read on every call, and the optimistic concurrency assertion is untouched — a stale entry costs a larger fold, never a wrong aggregate and never a suppressed concurrency failure.

Worth more here than on either sibling, and for a different reason. There the cache removes a snapshot load; Fisher's FetchForWriting folds the whole stream on every call by design, so a hit removes the fold of the history.

Two implementation notes that matter if you are reading the code: nothing is written back at fetch time (an entry published while the caller still holds the instance defeats take-on-read), and the version stored is the one read before the unit of work — because Fisher's inline projection, unlike Marten's, leaves the fetched instance alone.

⚠️ A cached baseline is derived state, so event rewriting does not reach it, exactly as it does not reach a snapshot, document or flat table. Leave an aggregate whose history you mask unenrolled.

PendingStreams on the document contract (#96)

jasperfx#673 added IDocumentSessionOperations.PendingStreams — the StreamActions a session has queued and not yet committed, for a listener or pre-commit hook deciding something from what the session is about to write, without naming a store. Fisher's forward is a snapshot and includes the session's tenant scopes, because those commit in the same transaction.

session.Events.PendingStreams is unchanged and remains the native spelling.

JasperFx 2.51.0 (#98)

The floor moves to 2.51.0. The one requirement was fixture-side: DocumentComplianceConfig.StreamIdentity (jasperfx#672) replaced an inference Fisher's document compliance fixture was making.

Also in this release

  • #95 closed — the binary-event column swap it recorded shipped fixed in 0.8.0. If you ran 0.7.x with your own IEventBinarySerializer and any of the four Enable* metadata options, rows written then have their BLOB and correlation id transposed; there is no automatic repair, and 0.8.0 onward is unaffected.

Known issue

#102WaitForNonStaleProjectionDataAsync (and QueryForNonStaleData behind it) can return while an async shard that has not started yet is still stale, because it compares against the progression rows that exist rather than the shards that are registered. Pre-existing since the daemon landed rather than new in this release; found from an intermittent CI failure while preparing it, and fixed next.

Compatibility

No breaking changes. Requires JasperFx 2.51.0; Weasel stays at 9.24.0.