Releases: JasperFx/marten
6.4.0
🚀 What's New
- Added Support to stream JSON in ASP.NET with raw SQL to HttpContext by @kwestground in #2783
✏️ What's Changed
- Updated peer dependencies by minor version by @oskardudycz in #2788, #2790
- Fixed conjoined tenancy handing in Custom Aggregation Projections. A follow-up to #2497, which missed custom aggregation projections in the initial changes set. by @haefele in #2764
- Fixed event type handling order to be predictive in projection handling. There was an edge case causing code generation to generate event type handling order in a non-predictive manner. PR fixed sorting for pattern matching encapsulating logic in
EventTypePatternMatchFrame
by @svrx in #2760 - Hidden visibility of the old aggregations type by applying
EditorBrowsable
attribute by @gfoidl in #2784
📄 Docs updates and CI
- Update wording in Document Identity and the Introduction docs by @mjeaton in #2763, #2765
- Renamed
Custom Projection
toCustom Aggregations
in Event Sourcing docs menu by @gfoidl in #2774 - Replaced (internal)
Event<T>
withIEvent<T>
in docs by @gfoidl in #2776
New Contributors
- @mjeaton made their first contribution in #2763
- @haefele made their first contribution in #2764
- @kwestground made their first contribution in #2783
Full Changelog: v6.3.0...v6.4.0
Milestone: https://github.com/JasperFx/marten/milestone/104?closed=1
6.3.0
🚀 What's New
- Added optional metadata column to maintain created timestamp in documents. Previously, we had the last modified column deleted at, etc. Now you can also track when the document was created by @ribbal in #2741
- Add stream key variants of batched event query operations. Now you can do batch event queries not only if you use Guids as your stream ids. by @elexisvenator in #2742
- Add
IEvent<TEvent>
fanout overload on multistream projection. Now you can also define projections' FanOut rules to event with metadata. by @erdtsieck in #2748
✏️ What's Changed
- Making DocumentStore implement IAsyncDisposable and drain the tombstone block on dispose async. That should help in dead letter events queue resiliency by @jeremydmiller in #2757, #2737
- Applying the retry policy to opening database connections. When opening the connection and database got the transient error, the connection was not retried. Now it is. by @jeremydmiller in #2758
- Made AsyncDaemonHealthCheck constructor public to enable proper usage in ASP.NET middleware conventions. Tweak to properly handle Async Daemon health checks. by @daveHylde in #2727
- Updated peer dependencies by minor version. That includes Critter Stack libraries, and also improved concurrent indexes handling added in Weasel 6.1.2 by @oskardudycz in #2759
📄 Docs updates and CI
- Added initial documentation about integration testing by @erdtsieck in #2732
- Adjusted information about the column mapping naming convention in Flat Table Projection documentation by @ogysha in #2755
- Adjusted Async projection test with IoC injection to remove flakiness by @oskardudycz in #2756
New Contributors
Full Changelog: v6.2.0...v6.3.0
Milestone: https://github.com/JasperFx/marten/milestone/102?closed=1
6.2.0
🚀 What's New
- Added a new facility to work with IoC services in projections. Closes… by @jeremydmiller in #2722
✏️ What's Changed
- Using standard marten exception transformers in UpdateBatch.ApplyC… by @jeremydmiller in #2710
- Projection error handling improvements by @jeremydmiller in #2711
- Addressed the issue of the detector having trouble with a gap from th… by @jeremydmiller in #2717
- Fixed registration issues with AddMartenStore overload. Closes GH-2659 by @jeremydmiller in #2721
- Projection rebuild & doc improvements by @jeremydmiller in #2723
- StoreOptions.AutoCreateSchemaObjects xml doc fix by @mtech-mrajahalme in #2720
- Check for null identifier on add event. by @micahosborne in #2635
- Lazy serialization config by @jeremydmiller in #2724
- Upgrading Weasel to 6.1.1 by @jeremydmiller in #2726
📄 Docs updates
- AsyncHealthCheck docs updated by @daveHylde in #2716
New Contributors
- @mtech-mrajahalme made their first contribution in #2720
- @micahosborne made their first contribution in #2635
Full Changelog: 6.1.0...v6.2.0
6.1.0
🚀 What's New
- Added
AsyncDaemonHealthCheck
to track events handling lag in async projections. Marten now supports a customizable HealthChecks. This can be useful when running the async daemon in a containerized environment such as Kubernetes. The check will verify that no projection's progression lags more than maxEventLag behind the HighWaterMark. The default maxEventLag is 100. Read more in HealthChecks documentation by @daveHylde in #2679
✏️ What's Changed
- Fixed Marten Exceptions transformations when
NpgslCommand
is null. Now you'll see all exception details again when connection to the database cannot be established because of wrong credentials, database unavailability, etc., by @oskardudycz in #2689, #2670 - Set
DeadLetterEvent
as single tenanted for conjoined tenancy. Previously, it was following the global conventions around tenancy, which could be confusing. A dead letter event represents an event skipped for the particular projection. It references that event at a specific global event store sequence. Thus, it has to be global and does not have a tenant. If we rebuild the projection, all read models will be rebuilt using events from all tenants. Read more in the poison event detection docs. by @oskardudycz in #2690, #2686 - Enhanced ProjectionUpdateBatch disposal. There could be a race condition when the session was released, but the processing Queue wasn't completed, which caused the session to be null. Added nullable annotations to make that explicit and fixes accordingly (by checking the cancellation token and implementing disposal consistently). by @oskardudycz in #2690, #2686
- Fixed
NGramIndex
schema SQL diff generation. Now it won't be always dropped & recreated. by @mysticmind JasperFx/weasel#96, #2677 - Updated Weasel to 6.1.0 and other dependencies by @oskardudycz in #2677, #2701
- Added
readonly
modifier to fields that are never changed in various places throughout the codebase by @Lehonti in #2669
📄 Docs updates
- Rewrote introduction docs to make it more accessible and user-friendly by @oskardudycz in #2668
- Added documentation for Using Custom Grouper with Fan Out Feature for Event Projections. It's a useful feature when you want to make event transformations to fine-tune events for projections without impacting the regular event design. by @erdtsieck in #2695
- Added warning regarding connection bleed to the async-enumerable docs. Be aware not to return the
IAsyncEnumerable
out of the scope in which the session that produces it is used. This would prevent the database connection from being reused afterwards and thus lead to a connection bleed. by @FelixLorenz in #2673 - Fixed
mt_doc_deadletterevent
table name in Async Daemon docs by @GKotfis in #2700 - Added building docs steps to PR pipeline to find dead links earlier than after merge by @oskardudycz in #2671
- Excluded pure docs changes to trigger the code build (as we had dedicated pipelines for docs) by @oskardudycz in #2676
See also related Weasel 6.1.0 release notes.
New Contributors
- @Lehonti made their first contribution in #2669
- @FelixLorenz made their first contribution in #2673
- @daveHylde made their first contribution in #2679
- @GKotfis made their first contribution in #2700
- @erdtsieck made their first contribution in #2695
Full Changelog: 6.0.4...6.1.0
6.0.5
✏️ What's Changed
- Fixes event types aliases resolution for not mapped explicitly event types. This ensures that you don't need to use
AddEventTypes
explicitly when rebuilding custom projections. by @Hawxy in #2647, #2650 - Fixed querying for primitive types in custom SQL by @Hawxy in #2642
- Fixed provider file code generation for LiveStreamAggregation. In release 6.0.3 we introduced the regression that disabled Provider files code generation. This could be an issue for people using pre-generated build files and static-type load mode. Now it's working correctly: generating code files, but not a redundant table. by @oskardudycz in #2654, #2645
- Fixed calculating delta for Full-Text Index with multiple columns. Now it won't always be trying to recreate indexes on subsequent migrations run by @oskardudycz in #2656
- Extended test coverage and documentation around automatically enabling extensions for tenants. Explained in more detail why Marten can't predict tenants if they're not set in configuration. Showed examples of dynamic tenant generation and applying migrations for database per tenant configuration. Read more in the documentation. by @T0shik and @oskardudycz in #2637
- Added test for computed index on DateTime column migration by @oskardudycz in #2655
Full Changelog: 6.0.4...6.0.5
Milestone: https://github.com/JasperFx/marten/milestone/99
6.0.4
✏️ What's Changed
- Enabled async projections to respect
EnableDocumentTrackingByIdentity
in regular mode, not only during the rebuild. It appeared that this setting worked for rebuilds but wasn't correctly handled in regular usage, which caused the document operationsLoad
method not to check the pending changes and return null. Now it should be handled correctly in both modes. by @oskardudycz in #2634
Full Changelog: 6.0.3...6.0.4
Milestone: https://github.com/JasperFx/marten/milestone/98
6.0.3
✏️ What's Changed
- Stopped passing Connection string information into
MartenCommandException
. Fixed by that security risk of exposing database credentials information by @jeremydmiller in #2616, #2614 - Stopped creating redundant document tables for live stream aggregation. Live stream aggregation is made in-memory so no table is needed. It wasn't a serious issue, as it wasn't used, but it still could create confusion. Fixed by @jeremydmiller in #2616, #2610
- Fixed deadlock while rebuilding projections when there are zero events. by @jeremydmiller in #2616, #2519
- Rebuilding a projection now ensures that event storage exists. by @jeremydmiller in #2620, #2567
- Added warnings in docs around Transactions handling. Marten is unable to evaluate database migrations within a session that is created by enrolling in an ambient transaction (
TransactionScope
). If you need to use ambient transactions, you will need to apply database changes upfront. by @jeremydmiller in #2620, #1452, #2564 - Fixed Projections command line failure when by using a GUID as a constructor parameter for T in SingleStreamProjection. Projection code generation will ignore single argument constructor that takes primitive type by @jeremydmiller in #2617, #2607
- Add Dictionary ContainsKey support for value types Now you can use it in the Linq queries, e.g.
session.Query<Document>().Where(t => t.GuidDict.ContainsKey(guid))
by @Hawxy in #2626 - Support upcasters within async projections. Async Daemon filter didn't include the proper filter for event type name aliases by @Hawxy in #2625
- Upgraded Weasel and Oakton to 6.0.1 by @jeremydmiller in #2616
Full Changelog: 6.0.2...6.0.3
Milestone: https://github.com/JasperFx/marten/milestone/97?closed=1
6.0.2
✏️ What's Changed
- Fixed broken queries on properties with empty JSON.NET
[JsonProperty]
attributes by @elexisvenator in #2601 - Fixed LINQ queries with SELECT to return data when using JSON casing by @oskardudycz in #2612
- *Fixed handling of similarly named nested where clauses. When parsing expressions, marten will cache expression paths for future reuse. Unfortunately, the caching key was not specific enough. PR ensured that proper nesting is applied when caching. by @elexisvenator in #2603
- Fixed runtime error when parsing a query with
Include()
in a multitenant database by @elexisvenator in #2602
Full Changelog: 6.0.1...6.0.2
Milestone: https://github.com/JasperFx/marten/milestone/95?closed=1
6.0.1
✏️ What's Changed
Async Projections
- Ensured that the hot-cold coordinator exits if host cancellation occurred. That should help in the thread-intensive work, e.g. in the parallel test pipelines by @Hawxy in #2581
- Made EnableDocumentTrackingByIdentity async projection option to support custom IProjections. It appeared that it was only working for the built-in projections, we enhance that to enable using it also for custom projections by @oskardudycz in #2598
Docs
- Fixed broken markdown link in Schema Feature Extensions docs by @schnerring in #2584
- Added hint on how to use generic IConfigureMarten for multitentant database by @AlexZeitler in #2585
- Reworked introduction & getting started guidance to make it look 21st centurish by @Hawxy in #2589
New Contributors
- @schnerring made their first contribution in #2584
- @AlexZeitler made their first contribution in #2585
Full Changelog: 6.0.0...6.0.1
Milestone: https://github.com/JasperFx/marten/milestone/94?closed=1
6.0.0
📢 What's Breaking
-
Dropped support of .NET Core 3.1 and .NET 5 following the Official .NET Support Policy. That allowed us to benefit fully from recent .NET improvements around asynchronous code, performance etc. Plus made maintenance easier by removing branches of code. by @oskardudycz, @mohsin-mehmood in #2394, JasperFx/weasel#73, #2549
-
Upgraded Npgsql version to 7. We didn't face substantial issues this time, but see the Npgsql 7 release notes for detailed information about breaking changes. by @oskardudycz in #2394, JasperFx/weasel#73
-
Generic
OpenSession
store options (OpenSession(SessionOptions options)
does not track changes by default. Previously, it was using identity map. Other overloads ofOpenSession
didn't change the default behaviour but were made obsolete. We encourage using explicit session creation andLightweightSession
by default, as in the next major version, we plan to do the full switch. By @jeremydmiller. -
Renamed asynchronous session creation to include explicit Serializable name.
OpenSessionAsync
was misleading, as the intention behind it was to enable proper handling of Postgres' serialized transaction level. Renamed the method toOpenSerializableSessionAsync
and added explicit methods for session types. By @oskardudycz in #2514 -
Removed default projection lifecycle. We had different projection lifecycles that could depend on the projection type. That was confusing enough, and it could create nasty production issues in the case of missing that fact. We decided to make it explicit. By @oskardudycz in #2540
-
Removed obsolete methods marked as to be removed in the previous versions.:
- Removed synchronous
BuildProjectionDaemon
from theIDocumentStore
method. Use the asynchronous version instead. - Removed
Schema
fromIDocumentStore
. UseStorage
instead. - Replaced
GroupEventRange
inIAggregationRuntime
withSlicer
reference. - Removed unused
UseAppendEventForUpdateLock
setting. - Removed the
Searchable
method fromMartenRegistry
. UseIndex
instead.
By @mysticmind in #2538
- Removed synchronous
-
ASP.NET JSON streaming
WriteById
is now using correctly customonFoundStatus
. We had the bug and always used the default status. It was fixed in #2407. So it's enhancement but also technically a breaking change to the behaviour. We also addedonFoundStatus
to other methods, so you could specify, e.g.201 Created
status for creating a new record. By @gfoidl in #2407 -
Added Optimistic concurrency checks during documents' updates. Previously, they were only handled when calling the
Store
method; nowUpdate
uses the same logic. by @luboshl in #2478 -
Base state passed as parameter is returned from
AggregateStreamAsync
instead of null when the stream is empty.AggregateStreamAsync
allows passing the default state on which we're applying events. When no events were found, we were always returning null. Now we'll return the passed value. It is helpful when you filter events from a certain version or timestamp. It'll also be useful in the future for archiving scenarios. By @oskardudycz in #2543, #2541 -
Ensured events with both
Create
andApply
in stream aggregation were handled only once. When you defined both Create and Apply methods for the specific event, both methods were called for the single event. That wasn't expected behaviour. Now they'll be only handled once. By @elexisvenator in #2559 -
Added missing passing Cancellation Tokens in all async methods in public API. That ensures that cancellation is handled correctly across the whole codebase. Added the static analysis to ensure we won't miss them in the future. By @oskardudycz in #2488
-
All the Critter Stack dependencies like
Weasel
,Lamar
,JasperFx.Core
,Oakton
, andJasperFx.CodeGeneration
were bumped to the latest major versions. By @jeremydmiller and @oskardudycz #2394, #2417, #2419, #2485, #2512, #2526, #2536, #2572
🚀 What's New
Dependencies
- Added official support for .NET 7 with the latest versions of
System.Text.Json
andNpgsql
, etc. by @oskardudycz in #2394
Documents
- Added possibility to specify that document can be single tenanted (
SingleTenanted
option) when the global convention is to have multi-tenanted. By @oskardudycz in #2497 - Added Optimistic concurrency checks during documents' updates. Previously, they were only handled when calling the
Store
method; nowUpdate
uses the same logic. by @luboshl and @jeremydmiller in #2478, #2439, #2501, #2526
Linq
- Added dynamic
OrderBy
extensions for batched queries. Now you can order by multiple properties and chain the ordering together with a sort order. Added possibility to specify select statements in batch query order by (e.g.select random()
). By @smbecker in #2356, #2362 - Json serializer attributes STJ
JsonPropertyName
and NewtonsoftJsonProperty
are now respected in Linq queries. Now, when you change the property name but use the old name thanks to the serializer attribute, Linq queries will use the name from the attribute. By @jeremydmiller in #2513, #2507
Connection Management
- Added explicit
LightweightSession
andIdentitySession
creation methods toDocumentStore
. Previously you could createDirtyTrackedSession
explicitly. Now you can create all types of sessions explicitly. We recommend using them explicitly instead of the genericOpenSession
method. By @oskardudycz in #2463
ASP.NET
- Added
onFoundStatus
to ASP.NET JSON streaming methods, so you could specify, e.g.201 Created
status for creating a new record. By @gfoidl in #2407
Projections
- Base state passed as parameter is returned from
AggregateStreamAsync
instead of null when the stream is empty.AggregateStreamAsync
allows passing the default state on which we're applying events. When no events when found, we were always returning null. Now we'll return the passed value. It is helpful when you filter events from a certain version or timestamp. It'll also be useful in the future for archiving scenarios. By @oskardudycz in #2543, #2541 - Add missing
ProjectAsync
aggregate overload for immutable read models Now you can use records in projections that do .NET async stuff. By @Hawxy in #2520
Async Projections
- Added support for reusing Documents in the same async projection batch . By default, Marten does batch to handle multiple events for the projection in one update. When using
EventProjection
and updating data manually usingIDocumentOperations
, this may cause changes made for previous batch items not to be visible. Now you can opt-in for tracking documents by an identity within a batch using theEnableDocumentTrackingByIdentity
async projection option. By @jeremydmiller, @oskardudycz and @Hawxy in #2510, #2527, #2472, #2473, #2517 - Enabled the possibility of applying projections with different Conjoined Tenancy scopes for projections. Enabled global projection for events with a conjoined tenancy style. By @oskardudycz in #2497, #2363
- Added console warning when async projections were registered, but no daemon was set up. By @jeremydmiller in #2511, #2509
Schema Management
- Added automatic retries when schema updates are running in parallel. Marten locks the schema update using advisory locks. Previously when acquiring lock failed, then schema update also failed. Now it will be retried, which enables easier parallel automated tests and running schema migration during the startup for the containerized environment. By @oskardudycz in #2479
- **Made possible...