Skip to content

Marten 9.57.0

Choose a tag to compare

@jeremydmiller jeremydmiller released this 02 Nov 17:32
· 397 commits to master since this release
0ef1800

Highlights

  • Compaction no longer deletes the history of a stream that folds to null. A stream deleted by its own aggregate, through ShouldDelete or DeleteEvent<T>, used to lose its whole history to an empty snapshot. Compaction now leaves it alone and logs an information line. (#5797)
  • Event data masking now reaches archived and skipped events. IncludeStream and IncludeEvents used to leave those rows in plain text and report success. (#5797)
  • opts.Events.AutoDiscoverTagTypes turns off automatic DCB tag type registration, for stores that use strong-typed identifiers but not DCB. It's on by default, and explicit RegisterTagType<T>() calls work either way. Thanks to @gschuager for the report and the design. (#5806)
  • EventStoreUsage reports the event store's TenancyStyle, so a console can tell conjoined events from conjoined documents. (#5805)
  • JasperFx 2.98.0 and Weasel 9.48.0.

Action needed after upgrading

If you rely on masking for archived or skipped events: run the same ApplyEventDataMasking call again. Data that was archived or skipped when you last ran it is still in plain text until you do.

That call runs your rules again over everything the first pass reached. If a rule isn't safe to run twice, such as one that draws a new pseudonym, add x.IsArchived to an IncludeEvents filter that still names the same subject:

x.IncludeEvents(e => e.StreamId == streamId && e.IsArchived)

Never use x.IsArchived as the whole filter, because that masks every archived event in the store.

If you compact streams: the deleted events can't be rebuilt from Marten. To find affected streams, replace <schema> and run this, then restore those streams from a backup or from wherever an archiver copied them:

select stream_id, version, tenant_id
from <schema>.mt_events
where mt_dotnet_type like 'JasperFx.Events.Compacted%'
  and 'null'::jsonb in (data->'Snapshot', data->'snapshot');

An archiver closed over IDocumentSession was never called for past compactions, so that copy won't exist.

Behaviour changes

  • IncludeEvents now includes archived events. A masking filter that needs only live events should add !x.IsArchived.
  • An events archiver closed over anything other than IDocumentOperations or IDocumentSession now throws InvalidOperationException before anything is queued. It used to be skipped silently, with the events deleted anyway. An archiver closed over IDocumentSession is now called.
  • Weasel 9.48.0: ToParameterType now throws for an unmapped type where it used to return a character catch-all. An enum resolves through its underlying type, so a long-backed enum gives Bigint. Marten's own call sites are not affected.

What's Changed

Full Changelog: v9.56.0...V9.57.0