JasperFx / marten

.NET Transactional Document DB and Event Store on PostgreSQL
https://martendb.io
MIT License
2.87k stars 457 forks source link

Exception when using SubscriptionBase with secondary store in 7.31 #3523

Closed DurinMusicspear closed 4 weeks ago

DurinMusicspear commented 4 weeks ago

Seems like there is a breaking change in Marten 7.31 using SubscriptionBase with a "SecondaryStore", if i use 7.30.3 it works perfectly but upgrading to 7.31 gives the following exception:

System.InvalidOperationException: 'OrderModule.OrderChangedEventSubscription' type only implements IAsyncDisposable. Use DisposeAsync to dispose the container. at void Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.Dispose() at Marten.Subscriptions.ScopedSubscriptionServiceWrapper1..ctor(IServiceProvider provider) at void Marten.MartenServiceCollectionExtensions.MartenStoreExpression1.<>cDisplayClass14_0`1.

b1(IServiceProvider s, StoreOptions opts) at StoreOptions Marten.Internal.SecondaryStoreConfig1.BuildStoreOptions(IServiceProvider provider) at T Marten.Internal.SecondaryStoreConfig1.Build(IServiceProvider provider) From Discord: Hawk said that `var scope = _provider.CreateScope();` should be replaced with `CreateAsyncScope` in `ScopedSubscriptionServiceWrapper`
jeremydmiller commented 4 weeks ago

It's gotta be smarter than that unfortunately. Fix coming up soon