Backport of the 2.x/9.x projections rebuild fix (#438 / #436, marten#4711) to the JasperFx 1.0 maintenance line, for marten#4718 (Marten 8.0 consumes JasperFx.Events 1.x).
Problem
dotnet run -- projections rebuild throws when an event subscription is registered (e.g. Wolverine's PublishEventsToWolverine(...) with SubscribeFromPresent()). A subscription (SubscriptionType.Subscription) is Async, so on the 1.x line ProjectionController.ExecuteRebuilds feeds its name into TryRebuildShardsAsync → RebuildProjectionAsync → TryFindProjection, which only searches projections and throws:
No registered projection matches the name '...'
The 1.x rebuild selection (ProjectionSelection) never excluded subscriptions or Live-lifecycle projections (only the continuous run path filters via FilterForAsyncOnly).
Fix
ProjectionSelection.RebuildableSubscriptions() excludes SubscriptionType.Subscription and ProjectionLifecycle.Live; ExecuteRebuilds uses it when building the names passed to TryRebuildShardsAsync. Subscriptions still run continuously and still appear in projections list; only rebuild skips them, and an explicitly-named subscription becomes a clean no-op.
Targets the 1.0 branch. Ships in JasperFx.Events 1.36.2.
Backport of the 2.x/9.x
projections rebuildfix (#438 / #436, marten#4711) to the JasperFx 1.0 maintenance line, for marten#4718 (Marten 8.0 consumes JasperFx.Events 1.x).Problem
dotnet run -- projections rebuildthrows when an event subscription is registered (e.g. Wolverine'sPublishEventsToWolverine(...)withSubscribeFromPresent()). A subscription (SubscriptionType.Subscription) isAsync, so on the 1.x lineProjectionController.ExecuteRebuildsfeeds its name intoTryRebuildShardsAsync→RebuildProjectionAsync→TryFindProjection, which only searches projections and throws:The 1.x rebuild selection (
ProjectionSelection) never excluded subscriptions or Live-lifecycle projections (only the continuousrunpath filters viaFilterForAsyncOnly).Fix
ProjectionSelection.RebuildableSubscriptions()excludesSubscriptionType.SubscriptionandProjectionLifecycle.Live;ExecuteRebuildsuses it when building the names passed toTryRebuildShardsAsync. Subscriptions still run continuously and still appear inprojections list; only rebuild skips them, and an explicitly-named subscription becomes a clean no-op.Targets the 1.0 branch. Ships in JasperFx.Events 1.36.2.